[FFmpeg-devel] [PATCH] Use sample size in case incorrect timestamps for aac in AVI (Ticket #1755)
Michael Niedermayer
michaelni at gmx.at
Wed Oct 10 16:49:10 CEST 2012
On Wed, Oct 10, 2012 at 06:03:30PM +0900, Heesuk Jung wrote:
> Understand and send patch again.
> Thanks for prompt response!
>
> From 2848da6b6092d68a8724d3b6a941e49b961c5e21 Mon Sep 17 00:00:00 2001
> From: Heesuk Jung <heesuk.jung at lge.com>
> Date: Wed, 10 Oct 2012 14:00:06 +0900
> Subject: [PATCH] Use sample size in case incorrect timestamps for aac in AVI (Ticket #1755)
>
> In some case for aac in AVI, avidec extracts wrong PTS value.
> (www.ffmpeg.org/trac/ffmpeg/ticket/1755)
> In getDuration function, I suggest using sample size instead of len.
>
> Also I have done regression test in our media pool.
>
> Test result of 11 problematic files is ok after patch apply.
> (11 files have fixed sample size in AVI Stream Header)
>
> Regression test reseult of 4 non-problematic files is ok after patch apply.
> (4 files have variable sample size in AVI Stream Header)
> ---
> libavformat/avidec.c | 16 ++++++++++------
> 1 files changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/libavformat/avidec.c b/libavformat/avidec.c
> index b4c5fe8..43d80ce 100644
> --- a/libavformat/avidec.c
> +++ b/libavformat/avidec.c
> @@ -115,9 +115,13 @@ static int guess_ni_flag(AVFormatContext *s);
> (tag >> 24) & 0xff, \
> size)
>
> -static inline int get_duration(AVIStream *ast, int len){
> +static inline int get_duration(AVIStream *ast, int len, enum AVCodecID codecId) {
> if(ast->sample_size){
> - return len;
> + if (codecId == AV_CODEC_ID_AAC) {
> + return ast->sample_size;
> + } else {
> + return len;
> + }
Ive commited a simpler fix (which is also more specific)
please test if its ok with the other files as well or if it needs
to be activated for more cases than ss=1024
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The real ebay dictionary, page 2
"100% positive feedback" - "All either got their money back or didnt complain"
"Best seller ever, very honest" - "Seller refunded buyer after failed scam"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121010/fc7410b5/attachment.asc>
More information about the ffmpeg-devel
mailing list