[FFmpeg-user] av_read_frames behaviour when stopping and resume read

Chen Fisher chen.fisher at gmail.com
Tue Feb 9 09:43:31 CET 2016


Hi,

I'm wondering what is the expected behaviour when stoping reading frames
(av_read_frame) for a while, while the connection is still opened and then
starting to read again.

I noticed several behaviours but I'm not sure if I should rely on any of
those:

1. When resuming reading I get the "old" frames until a point where I see a
"jump" to the present and start receive the current frames. This is what I
had expected.

2. av_read_frames blocks and I have to "interrupt_callback" to unblock it
but then I can't resume playing without first reopening the stream which
takes time.

What I'm doing is av_read_frame in a while loop running in a thread and
when I signal that thread it breaks from the loop and ends. Once I want to
resume playing I'm creating a new thread and start running on the
av_read_frame again. Doing this without closing the connection.

This has worked fine but I recently started seeing the second behaviour
where av_read_frame blocks.

Any Idea?

Thanks,
Chen


More information about the ffmpeg-user mailing list