aboutsummaryrefslogtreecommitdiffstats
path: root/tests/api/api-threadmessage-test.c
diff options
context:
space:
mode:
authorMarth64 <marth64@proxyid.net>2024-10-07 18:04:57 -0500
committerMarth64 <marth64@proxyid.net>2024-11-16 14:40:51 -0600
commita1ae66c827370b7caa90f10068bdd913f4cf2f18 (patch)
tree2919a5f21ac1965ed9cecb0e9d715741ec57a4d5 /tests/api/api-threadmessage-test.c
parent1964faa568c2b7bd9e172f7090a601625bb5dd9e (diff)
downloadffmpeg-a1ae66c827370b7caa90f10068bdd913f4cf2f18.tar.gz
avformat/dvdvideodec: reset the subdemuxer on discontinuity instead of flushing
DVDs naturally consist of segmented MPEG-PS blobs within a VOB (i.e. VOBs are not linear). NAV packs set the segment boundaries. When switching between segments, discontinuities occur and thus the subdemuxer needs to be reset. The current approach to manage this is by invoking ff_read_frame_flush() on the subdemuxer context, via a callback function which is invoked during the menu or dvdnav block functions. The same subdemuxer context is used throughout the demux, with a stretched PTS wrap bits value (64) + disabled overflow correction, and then flushed on each segment. Eventually, a play_end context variable is set to declare EOF. However, this approach causes frame drops. The block read flushes the demuxer before the frame read is complete, causing frames to drop on discontinuity. The play_end signal likewise ends playback before the frame read is complete, causing frames to drop at end of the title. To compound the issue, the PTS wrap bits value of 64 is wrong; the VOBU limit is actually 32 and the overflow correction should work. Instead, EOF the MPEG-PS subdemuxer organically when each VOB segment ends, and re-open it if needed with the offset after the full frame read is complete. In doing so, correct the PTS wrap behavior to 32 bits and remove the play_end/segment_started signals and callback pattern. Note that the timestamps as reported by the NAV packets are known as "PTMs", so the fields storing the time prior to adjustment are renamed accordingly. This makes it more clear when we are offsetting the NAV packet reported timestamps versus what we present as a demuxer. Signed-off-by: Marth64 <marth64@proxyid.net>
Diffstat (limited to 'tests/api/api-threadmessage-test.c')
0 files changed, 0 insertions, 0 deletions