Calculate the duration as accurately as possible to improve decoding of samples
where the last frame is smaller than the rest.
Example:
Take lossless-audio/luckynight-partial.tak from the FATE suit and convert it
to TTA muxed into matroska:
ffmpeg -i $(SAMPLES)/lossless-audio/luckynight-partial.tak -c:a tta lucky.mka
The framemd5 output for lucky.mka without this patch:
0, 0, 0, 46080, 184320, 7c3751ddd571d2903c3cf0ab4b3e3d0a
0, 46080, 46080, 46080, 184320, 6b70c782ba1da3f933fde2daa4f96b73
0, 92160, 92160, 46080, 184320, dcf70d89c54b9a4f0b302d4ec4fb302d
0, 138240, 138240, 46080, 184320, 48713ca38b388d2ea4abf5b86ed1226f
0, 184320, 184320, 46080, 184320, 12188a23648e7ebfb07cd6fe9197b2ea
0, 230400, 230400, 46080, 184320, 49653ab8186a5d4a044ed284671a26e0
0, 276480, 276480, 46080, 184320, 5e82c6a7fe58c7ea612c03a0a2927dd4
0, 322560, 322560, 46080, 184320, 83dc449dbd9eab5f2e8ad2b4403d6a21
0, 368640, 368640, 46080, 184320, bdd6b92c23d30978d4e802d305b0fc49
With this patch:
0, 0, 0, 46080, 184320, 7c3751ddd571d2903c3cf0ab4b3e3d0a
0, 46080, 46080, 46080, 184320, 6b70c782ba1da3f933fde2daa4f96b73
0, 92160, 92160, 46080, 184320, dcf70d89c54b9a4f0b302d4ec4fb302d
0, 138240, 138240, 46080, 184320, 48713ca38b388d2ea4abf5b86ed1226f
0, 184320, 184320, 46080, 184320, 12188a23648e7ebfb07cd6fe9197b2ea
0, 230400, 230400, 46080, 184320, 49653ab8186a5d4a044ed284671a26e0
0, 276480, 276480, 46080, 184320, 5e82c6a7fe58c7ea612c03a0a2927dd4
0, 322560, 322560, 46080, 184320, 83dc449dbd9eab5f2e8ad2b4403d6a21
0, 368640, 368640, 46080, 184320, bdd6b92c23d30978d4e802d305b0fc49
0, 414720, 414720, 4230, 16920, b50b440c5bbcecb8e9fbece643447593
The duration without this patch was calculated as 418950000000, which is bigger
than uint32_t and as such stored as 2338172288.
With this patch the duration is correctly calculated as 418950.
Signed-off-by: James Almer <jamrial@gmail.com>
Approved-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
In order to encapsuate Opus in Matroska, there is a new element
that has been added to the Matroska Spec, SeekPreRoll. It has the
duration in nanoseconds that has to be decoded before every seek.
Spec: http://matroska.org/technical/specs/index.html#SeekPreRoll
Proposal for encapsulateing Opus in Matroska:
http://wiki.xiph.org/MatroskaOpus
Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
The mov/mp4 muxer has support for handling negative timestamps
via edit lists (which customarily is used for handling the 1-frame
delay due to B-frames as well).
Using the muxer's native way of handling it is better than using
the generic offsetting. The generic offsetting is a bit too
crude when e.g. the timebase of one track is 1/fps, where the
edit lists can handle it accurately.
Signed-off-by: Martin Storsjö <martin@martin.st>
This reverts commit bf36dc50ea, reversing
changes made to b7fc2693c7.
Conflicts:
libavcodec/h264.c
Keeping support for the old VDPAU API has been requested by our VDPAU maintainer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Uses the 2.5 compatibility header included with the variant of
FFMS2 that uses AviSynth's C-interface. A copy of this header is
now provided in compat/avisynth.
avs_get_row_size_p and avs_get_height_p changed between versions
2.5 and 2.6. Since the avisynth_c.h header that avformat uses
assumes AviSynth 2.6, it would cause 2.5 to crash if given any
kind of real video (the Version() function was known to work,
though).
AvxSynth was unaffected by this issue because, despite being based
on AviSynth 2.5.8 and using 2.5.8's interface version number of 3,
it actually uses 2.6's versions of these functions.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
The case where decoding should only happen for keyframes and afterwards
(CODEC_FLAG2_SHOW_ALL not set) does not fully work neither before nor
after this
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'c59967fa7cc5bc2fa06b36c17d2c207240c06b3e':
h261: check the mtype index
Conflicts:
libavcodec/h261dec.c
The right half of the check is impossible to be true and thus replaced by
an assert()
See: ec3cd74f2d
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '9d86bfc259ae9ba7a76067ec931ff20fbb86ea2a':
hlsenc: Don't reset the number variable when wrapping
Conflicts:
libavformat/hlsenc.c
See: 75b9fb27f5
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '09c93b1b957f2049ea5fd8fb0e6f4d82680172f2':
hlsenc: Append the last incomplete segment when closing the output
Conflicts:
libavformat/hlsenc.c
See: 4630dfd1eb
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'c9031c7c1446a1a63eff7c0bf50d1ee559adf3fb':
hlsenc: Add a proper dependency on the mpegts muxer
Conflicts:
libavformat/Makefile
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'cb214707a6cb0d3272ec0261af6f1f5d8b7dabc7':
vp56data: Move all shared enum/struct declarations to common header
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '38f64c03301ac66d7b54b3e4bd2bf6454f9fb2d3':
mpeg12decdata.h: Move all tables to the only place they are used
Conflicts:
libavcodec/mpeg12decdata.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'c591d4575a6f97fbbe6145304b1ea960e8e81e14':
avcodec: Replace local extern declarations for tables with header #includes
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'd258531502b24cb653204fe4f003c8815755bdc4':
swscale: Mark a bunch of tables only used within one file static
Conflicts:
libswscale/swscale_unscaled.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '060ce0c697e261ca2792a7df30dfd1bae6900a4f':
ivi_common: Make some tables only used within the file static
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '4b054a3400f728c54470ee6a1eefe1d82420f6a2':
rtpproto: Check the right feature detection macro
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '163a729725c6eb0081b0af41a7279f7d19aee86e':
electronicarts: Let functions always returning the same value return void
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Implicit vector loads on POWER7 hardware can use the VSX
instruction set instead of classic Altivec/VMX. Let's force
a VMX load in this case.
Signed-off-by: Martin Storsjö <martin@martin.st>