avformat/takdec: Simplify data->hex conversion

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2021-12-03 23:18:35 +01:00
parent 6c57e0b4a8
commit 847d199138

View File

@ -109,7 +109,7 @@ static int tak_read_header(AVFormatContext *s)
break; break;
case TAK_METADATA_MD5: { case TAK_METADATA_MD5: {
uint8_t md5[16]; uint8_t md5[16];
int i; char md5_hex[2 * sizeof(md5) + 1];
if (size != 19) if (size != 19)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
@ -121,10 +121,9 @@ static int tak_read_header(AVFormatContext *s)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
av_log(s, AV_LOG_VERBOSE, "MD5="); ff_data_to_hex(md5_hex, md5, sizeof(md5), 1);
for (i = 0; i < 16; i++) md5_hex[2 * sizeof(md5)] = '\0';
av_log(s, AV_LOG_VERBOSE, "%02x", md5[i]); av_log(s, AV_LOG_VERBOSE, "MD5=%s\n", md5_hex);
av_log(s, AV_LOG_VERBOSE, "\n");
break; break;
} }
case TAK_METADATA_END: { case TAK_METADATA_END: {