diff options
author | David Conrad <lessen42@gmail.com> | 2007-09-05 00:23:03 +0000 |
---|---|---|
committer | David Conrad <lessen42@gmail.com> | 2007-09-05 00:23:03 +0000 |
commit | 815eb6a2feac389d4e144066bee1c3f3f6be0338 (patch) | |
tree | 4d3ce3b7fe625ae5640ad3681e93e856e79bb970 /libavformat/matroskaenc.c | |
parent | 90c02d93ff7bbc828a5fc919cb1370d3acf8c08d (diff) | |
download | ffmpeg-815eb6a2feac389d4e144066bee1c3f3f6be0338.tar.gz |
Track number and UID only have to be nonzero
Originally committed as revision 10308 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/matroskaenc.c')
-rw-r--r-- | libavformat/matroskaenc.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index 8a74ccb5bc..44df0b6744 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -149,10 +149,8 @@ static int mkv_write_header(AVFormatContext *s) 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 @@ static int mkv_write_packet(AVFormatContext *s, AVPacket *pkt) } 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); |