[FFmpeg-devel] Patch for ticket #1138

Eelco Lempsink eelco at lempsink.nl
Tue Apr 24 12:06:20 CEST 2012

On 17 apr. 2012, at 15:08, Eelco Lempsink wrote:
> Attached is a patch with a fix for trac issue #1138 (http://ffmpeg.org/trac/ffmpeg/ticket/1138)
> When using the copy codec and the -ss option (before the input) the PTS and DTS are read from the packet.  For MKVs there is no DTS in the packet which means it is copied from the input stream.  However, the seek offset is not taken into account.
> I found it a bit tricky to fix, since the first packet must have been read before the correct DTS can be determined and it depends on the format where the seek ended up exactly.  The big if statement basically checks if all values are equal to the ones set in init_input_stream and if so it assumes this is the first packet.
> This is my first FFmpeg patch, so please correct me if I misunderstood something.
> <0001-Fix-for-pts-dts-errors-in-case-of-stream-copying-aft.patch>


Eelco Lempsink

More information about the ffmpeg-devel mailing list