[FFmpeg-devel] [PATCH] mov.c: Use dimensions from tkhd
David Conrad
lessen42
Sun Jan 11 12:17:32 CET 2009
On Jan 11, 2009, at 2:54 AM, Baptiste Coudurier wrote:
> David Conrad wrote:
>> Hi,
>>
>> This sets the codec dimensions to what's set in in the tkhd. This is
>> useful for timed text because their dimensions are independent of
>> video
>> tracks and this is the only place they're stored. This shouldn't
>> affect
>> video since it'll later be overridden when reading the stsd.
>>
>> --- a/libavformat/mov.c
>> +++ b/libavformat/mov.c
>> @@ -1510,6 +1510,9 @@ static int mov_read_tkhd(MOVContext *c,
>> ByteIOContext *pb, MOVAtom atom)
>> width = get_be32(pb); // 16.16 fixed point track width
>> height = get_be32(pb); // 16.16 fixed point track height
>>
>> + st->codec->width = width >> 16;
>> + st->codec->height = height >> 16;
>> +
>> //transform the display width/height according to the matrix
>> // skip this if the display matrix is the default identity matrix
>> // to keep the same scale, use [width height 1<<16]
>>
>
> Humm, code will be lost here IMHO, I'd rather put fields in
> MOVStreamContext and set them only for subs in read_stsd to avoid side
> effects, future misbehaviour.
How's this?
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mov-tkhd-dimensions2.txt
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090111/ff6ee892/attachment.txt>
-------------- next part --------------
More information about the ffmpeg-devel
mailing list