wtv: move duplicated guids into wtv.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/6/merge
Peter Ross 12 years ago committed by Michael Niedermayer
parent 1701a22fce
commit e6ef628b1e
  1. 6
      libavformat/wtv.c
  2. 3
      libavformat/wtv.h
  3. 6
      libavformat/wtvdec.c
  4. 14
      libavformat/wtvenc.c

@ -32,6 +32,12 @@ const ff_asf_guid ff_data_guid =
{0x95,0xC3,0xD2,0xC2,0x7E,0x9A,0xDA,0x11,0x8B,0xF7,0x00,0x07,0xE9,0x5E,0xAD,0x8D}; {0x95,0xC3,0xD2,0xC2,0x7E,0x9A,0xDA,0x11,0x8B,0xF7,0x00,0x07,0xE9,0x5E,0xAD,0x8D};
const ff_asf_guid ff_SBE2_STREAM_DESC_EVENT = const ff_asf_guid ff_SBE2_STREAM_DESC_EVENT =
{0xED,0xA4,0x13,0x23,0x2D,0xBF,0x4F,0x45,0xAD,0x8A,0xD9,0x5B,0xA7,0xF9,0x1F,0xEE}; {0xED,0xA4,0x13,0x23,0x2D,0xBF,0x4F,0x45,0xAD,0x8A,0xD9,0x5B,0xA7,0xF9,0x1F,0xEE};
const ff_asf_guid ff_stream1_guid =
{0xA1,0xC3,0xD2,0xC2,0x7E,0x9A,0xDA,0x11,0x8B,0xF7,0x00,0x07,0xE9,0x5E,0xAD,0x8D};
const ff_asf_guid ff_sync_guid =
{0x97,0xC3,0xD2,0xC2,0x7E,0x9A,0xDA,0x11,0x8B,0xF7,0x00,0x07,0xE9,0x5E,0xAD,0x8D};
const ff_asf_guid ff_index_guid =
{0x96,0xC3,0xD2,0xC2,0x7E,0x9A,0xDA,0x11,0x8B,0xF7,0x00,0x07,0xE9,0x5E,0xAD,0x8D};
const ff_asf_guid ff_mediatype_audio = const ff_asf_guid ff_mediatype_audio =
{'a','u','d','s',FF_MEDIASUBTYPE_BASE_GUID}; {'a','u','d','s',FF_MEDIASUBTYPE_BASE_GUID};
const ff_asf_guid ff_mediatype_video = const ff_asf_guid ff_mediatype_video =

@ -40,6 +40,9 @@ extern const ff_asf_guid ff_wtv_guid;
extern const ff_asf_guid ff_timestamp_guid; extern const ff_asf_guid ff_timestamp_guid;
extern const ff_asf_guid ff_data_guid; extern const ff_asf_guid ff_data_guid;
extern const ff_asf_guid ff_SBE2_STREAM_DESC_EVENT; extern const ff_asf_guid ff_SBE2_STREAM_DESC_EVENT;
extern const ff_asf_guid ff_stream1_guid;
extern const ff_asf_guid ff_sync_guid;
extern const ff_asf_guid ff_index_guid;
extern const ff_asf_guid ff_mediatype_audio; extern const ff_asf_guid ff_mediatype_audio;
extern const ff_asf_guid ff_mediatype_video; extern const ff_asf_guid ff_mediatype_video;
extern const ff_asf_guid ff_format_none; extern const ff_asf_guid ff_format_none;

@ -879,9 +879,9 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p
!ff_guidcmp(g, (const ff_asf_guid){0x4E,0x7F,0x4C,0x5B,0xC4,0xD0,0x38,0x4B,0xA8,0x3E,0x21,0x7F,0x7B,0xBF,0x52,0xE7}) || !ff_guidcmp(g, (const ff_asf_guid){0x4E,0x7F,0x4C,0x5B,0xC4,0xD0,0x38,0x4B,0xA8,0x3E,0x21,0x7F,0x7B,0xBF,0x52,0xE7}) ||
!ff_guidcmp(g, (const ff_asf_guid){0x63,0x36,0xEB,0xFE,0xA1,0x7E,0xD9,0x11,0x83,0x08,0x00,0x07,0xE9,0x5E,0xAD,0x8D}) || !ff_guidcmp(g, (const ff_asf_guid){0x63,0x36,0xEB,0xFE,0xA1,0x7E,0xD9,0x11,0x83,0x08,0x00,0x07,0xE9,0x5E,0xAD,0x8D}) ||
!ff_guidcmp(g, (const ff_asf_guid){0x70,0xE9,0xF1,0xF8,0x89,0xA4,0x4C,0x4D,0x83,0x73,0xB8,0x12,0xE0,0xD5,0xF8,0x1E}) || !ff_guidcmp(g, (const ff_asf_guid){0x70,0xE9,0xF1,0xF8,0x89,0xA4,0x4C,0x4D,0x83,0x73,0xB8,0x12,0xE0,0xD5,0xF8,0x1E}) ||
!ff_guidcmp(g, (const ff_asf_guid){0x96,0xC3,0xD2,0xC2,0x7E,0x9A,0xDA,0x11,0x8B,0xF7,0x00,0x07,0xE9,0x5E,0xAD,0x8D}) || !ff_guidcmp(g, ff_index_guid) ||
!ff_guidcmp(g, (const ff_asf_guid){0x97,0xC3,0xD2,0xC2,0x7E,0x9A,0xDA,0x11,0x8B,0xF7,0x00,0x07,0xE9,0x5E,0xAD,0x8D}) || !ff_guidcmp(g, ff_sync_guid) ||
!ff_guidcmp(g, (const ff_asf_guid){0xA1,0xC3,0xD2,0xC2,0x7E,0x9A,0xDA,0x11,0x8B,0xF7,0x00,0x07,0xE9,0x5E,0xAD,0x8D}) || !ff_guidcmp(g, ff_stream1_guid) ||
!ff_guidcmp(g, (const ff_asf_guid){0xF7,0x10,0x02,0xB9,0xEE,0x7C,0xED,0x4E,0xBD,0x7F,0x05,0x40,0x35,0x86,0x18,0xA1})) { !ff_guidcmp(g, (const ff_asf_guid){0xF7,0x10,0x02,0xB9,0xEE,0x7C,0xED,0x4E,0xBD,0x7F,0x05,0x40,0x35,0x86,0x18,0xA1})) {
//ignore known guids //ignore known guids
} else } else

@ -52,12 +52,6 @@ static const uint8_t legacy_attrib[] =
static const ff_asf_guid sub_wtv_guid = static const ff_asf_guid sub_wtv_guid =
{0x8C,0xC3,0xD2,0xC2,0x7E,0x9A,0xDA,0x11,0x8B,0xF7,0x00,0x07,0xE9,0x5E,0xAD,0x8D}; {0x8C,0xC3,0xD2,0xC2,0x7E,0x9A,0xDA,0x11,0x8B,0xF7,0x00,0x07,0xE9,0x5E,0xAD,0x8D};
static const ff_asf_guid stream1_guid =
{0xA1,0xC3,0xD2,0xC2,0x7E,0x9A,0xDA,0x11,0x8B,0xF7,0x00,0x07,0xE9,0x5E,0xAD,0x8D};
static const ff_asf_guid sync_guid =
{0x97,0xC3,0xD2,0xC2,0x7E,0x9A,0xDA,0x11,0x8B,0xF7,0x00,0x07,0xE9,0x5E,0xAD,0x8D};
static const ff_asf_guid index_guid =
{0x96,0xc3,0xd2,0xc2,0x7e,0x9a,0xda,0x11,0x8b,0xf7,0x00,0x07,0xe9,0x5e,0xad,0x8d};
enum WtvFileIndex { enum WtvFileIndex {
WTV_TIMELINE_TABLE_0_HEADER_EVENTS = 0, WTV_TIMELINE_TABLE_0_HEADER_EVENTS = 0,
@ -137,7 +131,7 @@ static void write_chunk_header(AVFormatContext *s, const ff_asf_guid *guid, int
avio_wl32(pb, stream_id); avio_wl32(pb, stream_id);
avio_wl64(pb, wctx->serial); avio_wl64(pb, wctx->serial);
if ((stream_id & 0x80000000) && guid != &index_guid) { if ((stream_id & 0x80000000) && guid != &ff_index_guid) {
WtvChunkEntry *t = wctx->index + wctx->nb_index; WtvChunkEntry *t = wctx->index + wctx->nb_index;
av_assert0(wctx->nb_index < MAX_NB_INDEX); av_assert0(wctx->nb_index < MAX_NB_INDEX);
t->pos = wctx->last_chunk_pos; t->pos = wctx->last_chunk_pos;
@ -179,7 +173,7 @@ static void write_index(AVFormatContext *s)
WtvContext *wctx = s->priv_data; WtvContext *wctx = s->priv_data;
int i; int i;
write_chunk_header2(s, &index_guid, 0x80000000); write_chunk_header2(s, &ff_index_guid, 0x80000000);
avio_wl32(pb, 0); avio_wl32(pb, 0);
avio_wl32(pb, 0); avio_wl32(pb, 0);
@ -263,7 +257,7 @@ static int write_stream_codec(AVFormatContext *s, AVStream * st)
{ {
AVIOContext *pb = s->pb; AVIOContext *pb = s->pb;
int ret; int ret;
write_chunk_header2(s, &stream1_guid, 0x80000000 | 0x01); write_chunk_header2(s, &ff_stream1_guid, 0x80000000 | 0x01);
avio_wl32(pb, 0x01); avio_wl32(pb, 0x01);
write_pad(pb, 4); write_pad(pb, 4);
@ -286,7 +280,7 @@ static void write_sync(AVFormatContext *s)
int64_t last_chunk_pos = wctx->last_chunk_pos; int64_t last_chunk_pos = wctx->last_chunk_pos;
wctx->sync_pos = avio_tell(pb) - wctx->timeline_start_pos; wctx->sync_pos = avio_tell(pb) - wctx->timeline_start_pos;
write_chunk_header(s, &sync_guid, 0x18, 0); write_chunk_header(s, &ff_sync_guid, 0x18, 0);
write_pad(pb, 24); write_pad(pb, 24);
finish_chunk(s); finish_chunk(s);

Loading…
Cancel
Save