diff options
author | jstebbins <[email protected]> | 2011-03-11 15:26:31 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2011-03-11 15:26:31 +0000 |
commit | 483648b11af3d0c9b3de4bfc6d7d4b6b0b125e1a (patch) | |
tree | a223dd2b6948173acb569974f581f2eebbdcb53a /contrib/ffmpeg | |
parent | 94b58a7b733fac763a8b9c8d4a3f9348540d47aa (diff) |
Fix mkv timestamps that derive from SimpleBlock and default track duration.
Since I've gotten no response to this patch yet on ffmpeg-devel, I'm
committing it here till someone has the time to look at it.
When a SimpleBlock has lacing (multiple frames in a block) the duration
of each frame should come from the default track duration. An initialization
error in ffmpeg causes them to set the duration to 0 which triggers
code higher in the stack to estimate the duration based on bitrate
and frame size. This is wildly inaccurate and leads to very bad timestamps.
Fixes issues with MakeMKV audio timestamps.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3835 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'contrib/ffmpeg')
-rw-r--r-- | contrib/ffmpeg/A00-mkv-simpleblock.patch | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/contrib/ffmpeg/A00-mkv-simpleblock.patch b/contrib/ffmpeg/A00-mkv-simpleblock.patch new file mode 100644 index 000000000..9d24799ef --- /dev/null +++ b/contrib/ffmpeg/A00-mkv-simpleblock.patch @@ -0,0 +1,13 @@ +diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c +index a356611..0b35f15 100644 +--- a/libavformat/matroskadec.c ++++ b/libavformat/matroskadec.c +@@ -1852,6 +1852,8 @@ static int matroska_parse_cluster(MatroskaDemuxContext *matroska) + for (i=0; i<blocks_list->nb_elem; i++) + if (blocks[i].bin.size > 0 && blocks[i].bin.data) { + int is_keyframe = blocks[i].non_simple ? !blocks[i].reference : -1; ++ if (!blocks[i].non_simple) ++ blocks[i].duration = AV_NOPTS_VALUE; + res=matroska_parse_block(matroska, + blocks[i].bin.data, blocks[i].bin.size, + blocks[i].bin.pos, cluster.timecode, |