<div dir="ltr">Hi,<div><br></div><div>In my project, I am trying to demux the data in the memory using custom IO feature of ffmpeg, and the data is not in my control, another closed source player is managing the data and I am intercepting and then storing it in a byte array.</div><div><br></div><div>in a more understandable way,</div><div><br></div><div>|closed source player|  ----->  |proxy| -----> | resource on internet (fragmented mp4)|</div><div>and in the proxy box, the data is intercepted and send it to the bytearray</div><div><br></div><div>ffmpeg side,</div><div><br></div><div>|proxy|   --->  memory byte array ---> |ffmpeg custom io callback functions, read, seek|</div><div><br></div><div>So, when ever ffmpeg needs data, the read and seek functions are called, and the bytes are provided from the byte array</div><div><br></div><div>So far, it's working fine, the issue that I can not handle/don't know how to handle is below,</div><div><br></div><div>1. Internet connection is very bad and closed source player is waiting for new bytes</div><div>2. Since ffmpeg demuxer is depending on the response of closed source request' responses, it's also waiting in the read callback.</div><div>3. In this case, if the user does seek to a future point, then I am returning 0 to read callback (because the seek op requires another read op and the current one that is waiting needs to be returned)</div><div>4. when I return the waiting read callback with 0 and for the first time, the seek op is handled and I can see that the new offset is set and and waiting the new bytes of the new offset.</div><div>5. If the user do another seek op in this time, again I am returning 0 to read callback, but this time, mov demuxer somehow set the new offset in the beginning of the file which is wrong byte offset.</div><div><br></div><div>The above scenario may seem complex but it's not, it's very similar to common scenario like below </div><div>1. internet is very slow - even no data</div><div>2. player is waiting for bytes to continue playing</div><div>3. in this case, user is seeking a future point</div><div>4. then user is seeking to another future point</div><div><br></div><div><br></div><div>I am basically asking what we should do to cancel the waiting read callback properly to do seek operation ? Thanks</div><div><br></div><div>Regards,</div><div><br></div><div>MG</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div>