From 9f6582c6480d9fcdc52abd34ea952a7af8ba1914 Mon Sep 17 00:00:00 2001 From: waker Date: Sat, 21 Jan 2012 16:30:48 +0100 Subject: aac: fixed an issue when some mp4 files had double duration --- plugins/aac/aac.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'plugins/aac') diff --git a/plugins/aac/aac.c b/plugins/aac/aac.c index 4c7811a5..3036fced 100644 --- a/plugins/aac/aac.c +++ b/plugins/aac/aac.c @@ -332,9 +332,11 @@ aac_probe (DB_FILE *fp, const char *fname, MP4FILE_CB *cb, float *duration, int if (mp4ASC.frameLengthFlag == 1) { mp4framesize = 960; } - if (mp4ASC.sbr_present_flag == 1) { - mp4framesize *= 2; - } + // commented this out, since it fixes double-duration bug on + // some mp4 files + //if (mp4ASC.sbr_present_flag == 1) { + // mp4framesize *= 2; + //} } else { trace ("NeAACDecAudioSpecificConfig failed, can't get mp4framesize\n"); @@ -344,6 +346,7 @@ aac_probe (DB_FILE *fp, const char *fname, MP4FILE_CB *cb, float *duration, int trace ("mp4 nsamples=%d, samplerate=%d, timescale=%d, duration=%lld\n", samples, *samplerate, mp4ff_time_scale(mp4, i), mp4ff_get_track_duration(mp4, i)); *duration = (float)tsamples / (*samplerate); + trace ("mp4 duration: %f (tsamples %d/samplerate %d)\n", *duration, tsamples, *samplerate); NeAACDecClose (dec); @@ -533,9 +536,9 @@ aac_init (DB_fileinfo_t *_info, DB_playItem_t *it) { if (mp4ASC.frameLengthFlag == 1) { info->mp4framesize = 960; } - if (mp4ASC.sbr_present_flag == 1) { - info->mp4framesize *= 2; - } +// if (mp4ASC.sbr_present_flag == 1) { +// info->mp4framesize *= 2; +// } } totalsamples *= info->mp4framesize; duration = (float)totalsamples / samplerate; @@ -593,9 +596,9 @@ aac_init (DB_fileinfo_t *_info, DB_playItem_t *it) { if (mp4ASC.frameLengthFlag == 1) { info->mp4framesize = 960; } - if (mp4ASC.sbr_present_flag == 1) { - info->mp4framesize *= 2; - } +// if (mp4ASC.sbr_present_flag == 1) { +// info->mp4framesize *= 2; +// } } //totalsamples *= info->mp4framesize; free (pConfig); -- cgit v1.2.3