summaryrefslogtreecommitdiff
path: root/plugins/aac
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2012-01-21 16:30:48 +0100
committerGravatar waker <wakeroid@gmail.com>2012-01-21 16:30:48 +0100
commit9f6582c6480d9fcdc52abd34ea952a7af8ba1914 (patch)
treee8a3a9eb0f4abfa6fdfc169bbeaedd3e4e7743a4 /plugins/aac
parent831ea20b554799d327bf8bbef2cbe096e027e8ad (diff)
aac: fixed an issue when some mp4 files had double duration
Diffstat (limited to 'plugins/aac')
-rw-r--r--plugins/aac/aac.c21
1 files changed, 12 insertions, 9 deletions
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);