[FFmpeg-trac] #8009(avformat:new): hls demuxer does not handle pid changes after EXT-X-DISCONTINUITY
FFmpeg
trac at avcodec.org
Fri Jan 20 05:11:03 EET 2023
#8009: hls demuxer does not handle pid changes after EXT-X-DISCONTINUITY
------------------------------------+------------------------------------
Reporter: Aman | Owner: (none)
Type: defect | Status: new
Priority: normal | Component: avformat
Version: git-master | Resolution:
Keywords: hls | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
------------------------------------+------------------------------------
Comment (by Vraz):
> Before the discontinuity, 0x101 is a video PID but afterwards it is an
audio PID.
ffmpeg does not detect this PMT change, and feeds audio packets into the
video decoder and vice versa.
Enabled merge_pmt_versions within hls.c, and instead of preventing extra
streams, it duplicates the above issue. The problem is
mpegts.c::find_matching_stream() is super simplistic and unclear if it
ever does anything useful. It fails to verify the stream-type prior to
merging thus often resulting in damaged streams.
Changed find_matching_stream() to match on program_num and stream_type and
that seemed to resolve it. Might have other side-effects, but OTT Pluto
worked well with limited testing.
My player needs to work with OS distributed builds so hooked the read-
packet calls to trick mpegts into seek-after-segment. Will leave it to
others to decide whether updating find_matching_streams makes sense. (Not
possible to retrofit that behavior.)
--
Ticket URL: <https://trac.ffmpeg.org/ticket/8009#comment:7>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list