diff options
author | wm4 <nfxjfg@googlemail.com> | 2014-09-20 13:48:05 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-09-20 19:46:25 +0200 |
commit | d87fe2687fdc5b1cb9aaec957afadb56d207618f (patch) | |
tree | 0bc6a62e2054495f5393277f20c42e5d7988f087 /libavformat/avformat.h | |
parent | 7ac6b8cfa7e6af3f8ebd468607cacdbb386feb8f (diff) |
avformat/mp3dec: fix gapless audio support
The code already had skipping of initial padding, but discarding
trailing frame padding was missing.
This is somewhat questionable, because it will make the decoder discard
any data after the declared file size in the LAME header. But note that
skipping full frames at the end of the stream is required. Encoders
actually create such files.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/avformat.h')
-rw-r--r-- | libavformat/avformat.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h index b915148ad7..2370cb08da 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1031,6 +1031,14 @@ typedef struct AVStream { int skip_samples; /** + * If not 0, the first audio sample that should be discarded from the stream. + * This is broken by design (needs global sample count), but can't be + * avoided for broken by design formats such as mp3 with ad-hoc gapless + * audio support. + */ + int64_t end_discard_sample; + + /** * Number of internally decoded frames, used internally in libavformat, do not access * its lifetime differs from info which is why it is not in that structure. */ |