Skip to content

Commit 30d0544

Browse files
Add better debugging of codec_tag in zm_dump_codec and zm_dump_codecpar
1 parent 664cdd5 commit 30d0544

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/zm_ffmpeg.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,15 +400,18 @@ static void zm_log_fps(double d, const char *postfix) {
400400
}
401401

402402
void zm_dump_codecpar(const AVCodecParameters *par) {
403-
Debug(1, "Dumping codecpar codec_type %d %s codec_id %d %s codec_tag %" PRIu32
403+
Debug(1, "Dumping codecpar codec_type %d %s codec_id %d %s codec_tag %c%c%c%c"
404404
" width %d height %d bit_rate%" PRIu64 " bpcs %d bprs %d format%d %s"
405405
" extradata:%d:%s profile %d level %d field order %d color_range %d"
406406
" color_primaries %d color_trc %d color_space %d location %d video_delay %d",
407407
static_cast<int>(par->codec_type),
408408
av_get_media_type_string(par->codec_type),
409409
static_cast<int>(par->codec_id),
410410
avcodec_get_name(par->codec_id),
411-
par->codec_tag,
411+
(char)(par->codec_tag& 0xFF),
412+
(char)((par->codec_tag >> 8) & 0xFF),
413+
(char)((par->codec_tag >> 16) & 0xFF),
414+
(char)((par->codec_tag >> 24) & 0xFF),
412415
par->width,
413416
par->height,
414417
par->bit_rate,
@@ -437,12 +440,16 @@ void zm_dump_codecpar(const AVCodecParameters *par) {
437440
}
438441

439442
void zm_dump_codec(const AVCodecContext *codec) {
440-
Debug(1, "Dumping codec_context codec_type %d %s codec_id %d %s width %d height %d timebase %d/%d format %s profile %d level %d "
443+
Debug(1, "Dumping codec_context codec_type %d %s codec_id %d %s tag %c%c%c%c width %d height %d timebase %d/%d format %s profile %d level %d "
441444
"gop_size %d has_b_frames %d max_b_frames %d me_cmp %d me_range %d qmin %d qmax %d bit_rate %" PRId64 " qcompress %f extradata:%d:%s",
442445
codec->codec_type,
443446
av_get_media_type_string(codec->codec_type),
444447
codec->codec_id,
445448
avcodec_get_name(codec->codec_id),
449+
(char)(codec->codec_tag& 0xFF),
450+
(char)((codec->codec_tag >> 8) & 0xFF),
451+
(char)((codec->codec_tag >> 16) & 0xFF),
452+
(char)((codec->codec_tag >> 24) & 0xFF),
446453
codec->width,
447454
codec->height,
448455
codec->time_base.num,

0 commit comments

Comments
 (0)