[FFmpeg-devel] [PATCH] libavformat: fix copyts and muxrate in mpegts muxer
andreas.hakon at protonmail.com
Thu Apr 18 12:01:42 EEST 2019
This patch resolves one very specific use case:
- When you use the mpegts muxer;
- And use the global parameter “-copyts”;
- And use the parameter “-muxrate” for the mpegts muxer;
- And use too the parameter “-mpegts_copyts”.
The problem is created because the member “first_pcr” of the MpegTSWrite struct isn’t initialized with a correct timestamp (so when copying the timestamps the initial value is 0). And in this case an infinite loop is created because the code never writes PES packets when the “mux_rate” isn’t VBR (equals to 1). See the block that creates the loop here (note the "continue" command at end):
So, this patch fixes the problem initializing the “first_pcr” with the first DTS value that comes when using the incoming timestamps.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the ffmpeg-devel