[FFmpeg-devel] [PATCH 1/4] avformat/mov: set start_pad in samples and not in stream time_scale

Marton Balint cus at passwd.hu
Mon Mar 21 01:06:18 CET 2016


This usually does not matter, probably better this way.

Signed-off-by: Marton Balint <cus at passwd.hu>
---
 libavformat/mov.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 3fa8fcc..ee3fb96 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2689,8 +2689,8 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
             }
         }
 
-        if (!unsupported && st->codec->codec_id == AV_CODEC_ID_AAC && start_time > 0)
-            sc->start_pad = start_time;
+        if (!unsupported && st->codec->codec_id == AV_CODEC_ID_AAC && start_time > 0 && st->codec->sample_rate)
+            sc->start_pad = av_rescale(start_time, sc->time_scale, st->codec->sample_rate);
     }
 
     /* only use old uncompressed audio chunk demuxing when stts specifies it */
-- 
2.6.2



More information about the ffmpeg-devel mailing list