diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2008-08-23 23:43:20 +0000 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2008-08-23 23:43:20 +0000 |
commit | 5972945197d44e8bde6a986b9cba2e8196cfbc9c (patch) | |
tree | 94ba719e6f5efb53fc18d7eb38ccb96d25e7b194 /libavformat/movenc.c | |
parent | c30a4489b444020ef951c1f0583afd8679c07c78 (diff) | |
download | ffmpeg-5972945197d44e8bde6a986b9cba2e8196cfbc9c.tar.gz |
convert every muxer/demuxer to write/read sample_aspect_ratio from/to
the corresponding AVStream instead of AVCodecContext
Originally committed as revision 14933 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r-- | libavformat/movenc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index b7601a13da..5e3b34a03e 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -887,7 +887,7 @@ static int mov_write_mdia_tag(ByteIOContext *pb, MOVTrack *track) return updateSize(pb, pos); } -static int mov_write_tkhd_tag(ByteIOContext *pb, MOVTrack *track) +static int mov_write_tkhd_tag(ByteIOContext *pb, MOVTrack *track, AVStream *st) { int64_t duration = av_rescale_rnd(track->trackDuration, globalTimescale, track->timescale, AV_ROUND_UP); int version = duration < INT32_MAX ? 0 : 1; @@ -930,7 +930,7 @@ static int mov_write_tkhd_tag(ByteIOContext *pb, MOVTrack *track) /* Track width and height, for visual only */ if(track->enc->codec_type == CODEC_TYPE_VIDEO) { - double sample_aspect_ratio = av_q2d(track->enc->sample_aspect_ratio); + double sample_aspect_ratio = av_q2d(st->sample_aspect_ratio); if(!sample_aspect_ratio) sample_aspect_ratio = 1; put_be32(pb, sample_aspect_ratio * track->enc->width*0x10000); put_be32(pb, track->enc->height*0x10000); @@ -978,12 +978,12 @@ static int mov_write_uuid_tag_psp(ByteIOContext *pb, MOVTrack *mov) return 0x34; } -static int mov_write_trak_tag(ByteIOContext *pb, MOVTrack *track) +static int mov_write_trak_tag(ByteIOContext *pb, MOVTrack *track, AVStream *st) { offset_t pos = url_ftell(pb); put_be32(pb, 0); /* size */ put_tag(pb, "trak"); - mov_write_tkhd_tag(pb, track); + mov_write_tkhd_tag(pb, track, st); if (track->mode == MODE_PSP || track->hasBframes) mov_write_edts_tag(pb, track); // PSP Movies require edts box mov_write_mdia_tag(pb, track); @@ -1350,7 +1350,7 @@ static int mov_write_moov_tag(ByteIOContext *pb, MOVContext *mov, //mov_write_iods_tag(pb, mov); for (i=0; i<mov->nb_streams; i++) { if(mov->tracks[i].entry > 0) { - mov_write_trak_tag(pb, &(mov->tracks[i])); + mov_write_trak_tag(pb, &(mov->tracks[i]), s->streams[i]); } } |