Commit 6081f8c4 authored by Mans Rullgard's avatar Mans Rullgard

avidec: make print_tag() a macro and remove related ifdefs

The dprintf macro is a no-op if DEBUG is not defined, so there
is no need to guard it here.
Signed-off-by: 's avatarMans Rullgard <mans@mansr.com>
parent 119cc033
...@@ -84,17 +84,13 @@ static const char avi_headers[][8] = { ...@@ -84,17 +84,13 @@ static const char avi_headers[][8] = {
static int avi_load_index(AVFormatContext *s); static int avi_load_index(AVFormatContext *s);
static int guess_ni_flag(AVFormatContext *s); static int guess_ni_flag(AVFormatContext *s);
#ifdef DEBUG #define print_tag(str, tag, size) \
static void print_tag(const char *str, unsigned int tag, int size) dprintf(NULL, "%s: tag=%c%c%c%c size=0x%x\n", \
{ str, tag & 0xff, \
dprintf(NULL, "%s: tag=%c%c%c%c size=0x%x\n", (tag >> 8) & 0xff, \
str, tag & 0xff, (tag >> 16) & 0xff, \
(tag >> 8) & 0xff, (tag >> 24) & 0xff, \
(tag >> 16) & 0xff, size)
(tag >> 24) & 0xff,
size);
}
#endif
static inline int get_duration(AVIStream *ast, int len){ static inline int get_duration(AVIStream *ast, int len){
if(ast->sample_size){ if(ast->sample_size){
...@@ -369,18 +365,17 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) ...@@ -369,18 +365,17 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
goto fail; goto fail;
tag = get_le32(pb); tag = get_le32(pb);
size = get_le32(pb); size = get_le32(pb);
#ifdef DEBUG
print_tag("tag", tag, size); print_tag("tag", tag, size);
#endif
switch(tag) { switch(tag) {
case MKTAG('L', 'I', 'S', 'T'): case MKTAG('L', 'I', 'S', 'T'):
list_end = url_ftell(pb) + size; list_end = url_ftell(pb) + size;
/* Ignored, except at start of video packets. */ /* Ignored, except at start of video packets. */
tag1 = get_le32(pb); tag1 = get_le32(pb);
#ifdef DEBUG
print_tag("list", tag1, 0); print_tag("list", tag1, 0);
#endif
if (tag1 == MKTAG('m', 'o', 'v', 'i')) { if (tag1 == MKTAG('m', 'o', 'v', 'i')) {
avi->movi_list = url_ftell(pb) - 4; avi->movi_list = url_ftell(pb) - 4;
if(size) avi->movi_end = avi->movi_list + size + (size & 1); if(size) avi->movi_end = avi->movi_list + size + (size & 1);
...@@ -447,9 +442,8 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) ...@@ -447,9 +442,8 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
if(amv_file_format) if(amv_file_format)
tag1 = stream_index ? MKTAG('a','u','d','s') : MKTAG('v','i','d','s'); tag1 = stream_index ? MKTAG('a','u','d','s') : MKTAG('v','i','d','s');
#ifdef DEBUG
print_tag("strh", tag1, -1); print_tag("strh", tag1, -1);
#endif
if(tag1 == MKTAG('i', 'a', 'v', 's') || tag1 == MKTAG('i', 'v', 'a', 's')){ if(tag1 == MKTAG('i', 'a', 'v', 's') || tag1 == MKTAG('i', 'v', 'a', 's')){
int64_t dv_dur; int64_t dv_dur;
...@@ -607,9 +601,8 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) ...@@ -607,9 +601,8 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
st->codec->palctrl->palette_changed = 1; st->codec->palctrl->palette_changed = 1;
} }
#ifdef DEBUG
print_tag("video", tag1, 0); print_tag("video", tag1, 0);
#endif
st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_tag = tag1; st->codec->codec_tag = tag1;
st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, tag1); st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, tag1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment