[FFmpeg-devel] [PATCH 1/5] wtvenc: do not emit stream2 and DSATTRIB_TRANSPORT_PROPERTY chunks; these are not required for playback
Peter Ross
pross at xvid.org
Wed Nov 7 06:51:51 CET 2012
---
libavformat/wtvenc.c | 30 +++---------------------------
tests/ref/lavf/wtv | 2 +-
2 files changed, 4 insertions(+), 28 deletions(-)
diff --git a/libavformat/wtvenc.c b/libavformat/wtvenc.c
index 1efa9c6..f79b96f 100644
--- a/libavformat/wtvenc.c
+++ b/libavformat/wtvenc.c
@@ -288,31 +288,16 @@ static void write_sync(AVFormatContext *s)
wctx->last_chunk_pos = last_chunk_pos;
}
-static void write_DSATTRIB_TRANSPORT_PROPERTIES_init(AVFormatContext *s, int stream_index)
-{
- AVIOContext *pb = s->pb;
- write_chunk_header2(s, &ff_DSATTRIB_TRANSPORT_PROPERTIES, 0x80000000 | stream_index);
- avio_wl64(pb, stream_index);
- avio_wl64(pb, -1);
- avio_wl64(pb, 0);
- finish_chunk(s);
-}
-
-static int write_stream_data(AVFormatContext *s, AVStream *st, int flag)
+static int write_stream_data(AVFormatContext *s, AVStream *st)
{
AVIOContext *pb = s->pb;
int ret;
- if (!flag) {
write_chunk_header2(s, &ff_SBE2_STREAM_DESC_EVENT, 0x80000000 | (st->index + INDEX_BASE));
avio_wl32(pb, 0x00000001);
avio_wl32(pb, st->index + INDEX_BASE); //stream_id
avio_wl32(pb, 0x00000001);
write_pad(pb, 8);
- } else {
- write_chunk_header2(s, &ff_stream2_guid, 0x80000000 | (st->index + INDEX_BASE));
- write_pad(pb, 4);
- }
ret = write_stream_codec_info(s, st);
if (ret < 0) {
@@ -364,28 +349,19 @@ static int write_header(AVFormatContext *s)
av_log(s, AV_LOG_ERROR, "write stream codec failed codec_type(0x%x)\n", st->codec->codec_type);
return -1;
}
- if (i + 1 < s->nb_streams) {
+ if (!i)
write_sync(s);
- }
}
for (i = 0; i < s->nb_streams; i++) {
st = s->streams[i];
- ret = write_stream_data(s, st, 0);
+ ret = write_stream_data(s, st);
if (ret < 0) {
av_log(s, AV_LOG_ERROR, "write stream data failed codec_type(0x%x)\n", st->codec->codec_type);
return -1;
}
- ret = write_stream_data(s, st, 1);
- if (ret < 0) {
- av_log(s, AV_LOG_ERROR, "write stream2 data failed codec_type(0x%x)\n", st->codec->codec_type);
- return -1;
- }
}
- for (i = 0; i < s->nb_streams; i++)
- write_DSATTRIB_TRANSPORT_PROPERTIES_init(s, INDEX_BASE + i);
-
if (wctx->nb_index)
write_index(s);
diff --git a/tests/ref/lavf/wtv b/tests/ref/lavf/wtv
index 24cf15d..6481160 100644
--- a/tests/ref/lavf/wtv
+++ b/tests/ref/lavf/wtv
@@ -1,3 +1,3 @@
-05aff2517b5bd436ec26c736b4b8372c *./tests/data/lavf/lavf.wtv
+accf6a5131e2eba81c9aa9fa8f0eb69a *./tests/data/lavf/lavf.wtv
413696 ./tests/data/lavf/lavf.wtv
./tests/data/lavf/lavf.wtv CRC=0xcc2dc628
--
1.7.10.4
-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121107/ee1795d6/attachment.asc>
More information about the ffmpeg-devel
mailing list