<font color='black' size='2' face='arial'>
<div style="font-family:arial,helvetica;font-size:10pt;color:black">

<div id="AOLMsgPart_1_c1a7e126-6919-4e62-9cd8-85b241e7a31d">
<font color="black" size="2" face="arial">Hi,

<div><br>

</div>



<div>I am using a Zeranoe build of ffmpeg 1.2.1 for windows 32-bit.  I am also using Java Native Access (JNA) to do the reading and writing of Java InputStreams. Has anyone had success using custom i/o reads and seeks with Zeranoe builds?   Are there any known bugs with custom i/o in this version?</div>



<div><br>

</div>



<div>I set  AVFormatCtx pFormatCtx.debug=1 to see the debug messages for reading packets and frames.  Packets and frames are read correctly during:</div>



<div><br>

</div>



<div>avformat_open_input();</div>



<div>avformat_find_stream_info();</div>



<div><br>

</div>



<div>However during the main reading/decoding loop:</div>



<div><br>

</div>



<div>while (av_read_frame(pFormatCtx, &pkt) > 0)</div>



<div>{</div>



<div>.</div>



<div>.</div>



<div>.</div>



<div>av_free_packet(&pkt)</div>



<div>}</div>



<div><br>

</div>



<div>Frames are read correctly up to a point. Then for the next packet, pkt.size is less than what was read during the avformat_find_stream_info() call.  This packet happens to be an audio packet and the av_decode_audio4 call fails. The next read returns a video packet, but pkt.size is also less than what was read earlier.  I can read no more packets after this.</div>



<div><br>

</div>



<div>I have tried setting different buffer sizes including zero (null) when I open the context avio_alloc_context().  This has no effect on the results. I  also tried setting AVFMT_FLAG_CUSTOM_IO and AVFMT_FLAG_NO_BUFFER: same results. I can only read and decode to the exact same point every time.</div>



<div><br>

</div>



<div>-Felix</div>

</font>
</div>

</div>
</font>