# HG changeset patch # User conrad # Date 1188951783 0 # Node ID 04ae6910d90374845ae37f06667b5f3ce66a0549 # Parent 5e587452dc48b1da1cddce38db6cd7c4dbcdaf31 Track number and UID only have to be nonzero diff -r 5e587452dc48 -r 04ae6910d903 matroskaenc.c --- a/matroskaenc.c Wed Sep 05 00:23:01 2007 +0000 +++ b/matroskaenc.c Wed Sep 05 00:23:03 2007 +0000 @@ -149,10 +149,8 @@ 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_TRACKNUMBER , i + 1); + put_ebml_uint (pb, MATROSKA_ID_TRACKUID , i + 1); put_ebml_uint (pb, MATROSKA_ID_TRACKFLAGLACING , 0); // no lacing (yet) if (st->language[0]) @@ -270,7 +268,7 @@ } block = start_ebml_master(pb, MATROSKA_ID_SIMPLEBLOCK); - put_byte(pb, 0x80 | pkt->stream_index); // this assumes stream_index is less than 127 + put_byte(pb, 0x80 | (pkt->stream_index + 1)); // this assumes stream_index is less than 126 put_be16(pb, pkt->pts - mkv->cluster_pts); put_byte(pb, !!(pkt->flags & PKT_FLAG_KEY)); put_buffer(pb, pkt->data, pkt->size);