Skip to content
Snippets Groups Projects
Commit 2d2432b7 authored by Baptiste Coudurier's avatar Baptiste Coudurier
Browse files

set audio frame size based on stts

Originally committed as revision 8462 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 4278662d
No related branches found
No related tags found
No related merge requests found
...@@ -1502,6 +1502,7 @@ static int mov_read_header(AVFormatContext *s, AVFormatParameters *ap) ...@@ -1502,6 +1502,7 @@ static int mov_read_header(AVFormatContext *s, AVFormatParameters *ap)
for(i=0; i<mov->total_streams; i++) { for(i=0; i<mov->total_streams; i++) {
MOVStreamContext *sc = mov->streams[i]; MOVStreamContext *sc = mov->streams[i];
AVStream *st = s->streams[i];
/* sanity checks */ /* sanity checks */
if(!sc->stts_count || !sc->chunk_count || !sc->sample_to_chunk_sz || if(!sc->stts_count || !sc->chunk_count || !sc->sample_to_chunk_sz ||
(!sc->sample_size && !sc->sample_count)){ (!sc->sample_size && !sc->sample_count)){
...@@ -1514,6 +1515,9 @@ static int mov_read_header(AVFormatContext *s, AVFormatParameters *ap) ...@@ -1514,6 +1515,9 @@ static int mov_read_header(AVFormatContext *s, AVFormatParameters *ap)
sc->time_scale= mov->time_scale; sc->time_scale= mov->time_scale;
av_set_pts_info(s->streams[i], 64, sc->time_rate, sc->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){ if(s->streams[i]->duration != AV_NOPTS_VALUE){
assert(s->streams[i]->duration % sc->time_rate == 0); assert(s->streams[i]->duration % sc->time_rate == 0);
s->streams[i]->duration /= sc->time_rate; s->streams[i]->duration /= sc->time_rate;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment