changeset 1938:1e93a2174dc6 libavformat

set audio frame size based on stts
author bcoudurier
date Wed, 21 Mar 2007 10:17:52 +0000
parents 4997738b316c
children f846a0c202b5
files mov.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mov.c	Wed Mar 21 10:03:27 2007 +0000
+++ b/mov.c	Wed Mar 21 10:17:52 2007 +0000
@@ -1502,6 +1502,7 @@
 
     for(i=0; i<mov->total_streams; i++) {
         MOVStreamContext *sc = mov->streams[i];
+        AVStream *st = s->streams[i];
         /* sanity checks */
         if(!sc->stts_count || !sc->chunk_count || !sc->sample_to_chunk_sz ||
            (!sc->sample_size && !sc->sample_count)){
@@ -1514,6 +1515,9 @@
             sc->time_scale= mov->time_scale;
         av_set_pts_info(s->streams[i], 64, sc->time_rate, sc->time_scale);
 
+        if (st->codec->codec_type == CODEC_TYPE_AUDIO && sc->stts_count == 1)
+            st->codec->frame_size = sc->stts_data[0].duration;
+
         if(s->streams[i]->duration != AV_NOPTS_VALUE){
             assert(s->streams[i]->duration % sc->time_rate == 0);
             s->streams[i]->duration /= sc->time_rate;