[FFmpeg-soc] [soc]: r251 - matroska/matroskaenc.c

Aurelien Jacobs aurel at gnuage.org
Thu Jun 14 18:08:21 CEST 2007


On Thu, 14 Jun 2007 00:50:44 +0200 (CEST)
conrad <subversion at mplayerhq.hu> wrote:

> Author: conrad
> Date: Thu Jun 14 00:50:44 2007
> New Revision: 251
> 
> Log:
> First stab at writing the tracks element, still needs some additional cases for certain codecs
> 
> Modified:
>    matroska/matroskaenc.c
> 
> Modified: matroska/matroskaenc.c
> ==============================================================================
> --- matroska/matroskaenc.c	(original)
> +++ matroska/matroskaenc.c	Thu Jun 14 00:50:44 2007
> @@ -112,7 +112,7 @@ static int mkv_write_header(AVFormatCont
>      MatroskaMuxContext *mkv = s->priv_data;
>      ByteIOContext *pb = &s->pb;
>      offset_t ebml_header, segment_info, tracks;
> -    int i;
> +    int i, j;
>  
>      ebml_header = start_ebml_master(pb, EBML_ID_HEADER);
>      put_ebml_uint   (pb, EBML_ID_EBMLVERSION        ,           1);
> @@ -141,9 +141,77 @@ static int mkv_write_header(AVFormatCont
>      tracks = start_ebml_master(pb, MATROSKA_ID_TRACKS);
>      for (i = 0; i < s->nb_streams; i++) {
>          AVStream *st = s->streams[i];
> -        offset_t track = start_ebml_master(pb, MATROSKA_ID_TRACKENTRY);
> +        AVCodecContext *codec = st->codec;
> +        offset_t subinfo, track;
> +        int native_id = 0;
> +
> +        track = start_ebml_master(pb, MATROSKA_ID_TRACKENTRY);
> +        put_ebml_uint (pb, MATROSKA_ID_TRACKNUMBER     , i);
> +        // XXX: random number for UID? and can we use the same UID when copying
> +        // from another MKV as the specs recommend?
> +        put_ebml_uint (pb, MATROSKA_ID_TRACKUID        , i);
> +        put_ebml_uint (pb, MATROSKA_ID_TRACKFLAGLACING , 0);    // no lacing (yet)

I think this is the right way to set the track UID.
Anyway, you have no way to know if you are remuxing from another mkv
file or from another format, so there is no way to use the same UID
as original file.

Aurel



More information about the FFmpeg-soc mailing list