diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2007-08-09 11:04:43 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2007-08-09 11:04:43 +0000 |
commit | efd8f22a167197fbaf2b23fb29bf7096fade65e4 (patch) | |
tree | ee2b11c6b56f2208756c8467a280676847e9f778 /libavformat/nutenc.c | |
parent | 4d75168f17259c385c284f5bf64963285445b78d (diff) | |
download | ffmpeg-efd8f22a167197fbaf2b23fb29bf7096fade65e4.tar.gz |
make StreamContext.time_base a pointer
Originally committed as revision 10010 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/nutenc.c')
-rw-r--r-- | libavformat/nutenc.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index cda4704f6f..5e7becaf68 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -236,29 +236,28 @@ static int write_header(AVFormatContext *s){ for(i=0; i<s->nb_streams; i++){ AVStream *st= s->streams[i]; - int num, denom, ssize; - ff_parse_specific_params(st->codec, &num, &ssize, &denom); + int ssize; + AVRational time_base; + ff_parse_specific_params(st->codec, &time_base.den, &ssize, &time_base.num); - nut->stream[i].time_base= (AVRational){denom, num}; - - av_set_pts_info(st, 64, denom, num); + av_set_pts_info(st, 64, time_base.num, time_base.den); for(j=0; j<nut->time_base_count; j++){ - if(!memcmp(&nut->stream[i].time_base, &nut->time_base[j], sizeof(AVRational))){ + if(!memcmp(&time_base, &nut->time_base[j], sizeof(AVRational))){ break; } } - nut->time_base[j]= nut->stream[i].time_base; + nut->time_base[j]= time_base; + nut->stream[i].time_base= &nut->time_base[j]; if(j==nut->time_base_count) nut->time_base_count++; - if(av_q2d(nut->stream[i].time_base) >= 0.001) + if(av_q2d(time_base) >= 0.001) nut->stream[i].msb_pts_shift = 7; else nut->stream[i].msb_pts_shift = 14; - nut->stream[i].max_pts_distance= FFMAX(1/av_q2d(nut->stream[i].time_base), 1); + nut->stream[i].max_pts_distance= FFMAX(1/av_q2d(time_base), 1); } -//FIXME make nut->stream[i].time_base pointers into nut->time_base put_buffer(bc, ID_STRING, strlen(ID_STRING)); put_byte(bc, 0); |