[FFmpeg-devel] [PATCH] When PMT is found, we have found mpegts header information

elupus elupus
Sun Apr 18 18:04:48 CEST 2010

On Sat, 17 Apr 2010 14:32:32 -0700, Baptiste Coudurier wrote:

> On 4/17/10 5:49 AM, elupus wrote:
>> They will however totaly be missed if we reduce probesize and pmt shows up
>> later. But i'll keep it local to xbmc for now, until ffmpeg get's a new
>> mpegts demuxer :)
> Absolutely not, you seem to be confused. Demuxer will keep parsing PMT 
> and add new encountered streams. You will notice it when the AVPacket 
> stream_id is new.
> That's why AVFMT_NOHEADER is set, here is the doxygen about it:
>      /** Read one packet and put it in 'pkt'. pts and flags are also
>         set. 'av_new_stream' can be called only if the flag
>         AVFMTCTX_NOHEADER is used.

Well what i meant was, for us to speed up starting, we'd have to reduce
probesize. Whatever size we set will be a guess with no guarantee there
will be a pmt there. So we get in the situation that we'd have to try
av_find_stream_info multiple times with successivly larger probesize if we
want to be able to keep startup delay down, and find streams.

> However with your patch, indeed streams will totally be missed and break
> the behaviour of the demuxer.

My patch only changes what happens during probesize, where it makes
av_find_stream_info stop after first pmt is found. It does not stop the
demuxer from adding more streams later (even as the doxy above would
suggest that is against api), so further stream will still be found.

More information about the ffmpeg-devel mailing list