[FFmpeg-devel] [PATCH] mov.c: Use dimensions from tkhd

Baptiste Coudurier baptiste.coudurier
Sun Jan 11 08:54:27 CET 2009


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.

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
checking for life_signs in -lkenny... no




More information about the ffmpeg-devel mailing list