On 07/05/15 15:41, John Högberg wrote:
> Hi,
> 
> libavformat currently doesn't provide any mechanism for detecting when a
> substream is no longer present but the stream as a whole is otherwise OK. Your
> best guess is to check when you last got any frames on it, which tends to work
> for video and audio but not for substreams that sometimes spend a long amount 
> of
> time without presenting anything, like subtitles.

It is an interesting functionality. If I understood it correctly it
would signal when a stream is not active anymore (in a transient or
permanent way?).

> I've attached my first attempt at a detection mechanism, implemented as an
> AVSTREAM_EVENT_FLAG. Depending on the demultiplexer it's either raised when 
> the
> substream carrier has died (e.g. if you have one pipe per substream and that 
> one
> in particular broke), or if its presence wasn't detected during the last call 
> to
> av_read_frame. I've added it to the MPEG-TS demultiplexer as that's where it
> itches, but I could see it being somewhat relevant for other formats as well.

> Does this sound useful to anyone but me?

I think it is.

> If yes, can you think of a better way of exposing this functionality?

I got a little confused about the terminology.

If I got it right you can use two flags to signal when the stream is
active and when it is no more and avoid the carrier type that way.

The functionality sounds quite good when you have to delay the probe
since you know that a stream with that id will be present but no data
for it is available yet.

lu

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to