From 8798078798c91886112c87804280e0c0ac810f70 Mon Sep 17 00:00:00 2001 From: simon987 Date: Sun, 19 Apr 2020 20:16:38 -0400 Subject: [PATCH] media meta fix --- libscan/media/media.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/libscan/media/media.c b/libscan/media/media.c index b46ea60..e744de9 100644 --- a/libscan/media/media.c +++ b/libscan/media/media.c @@ -247,10 +247,7 @@ void parse_media_format_ctx(scan_media_ctx_t *ctx, AVFormatContext *pFormatCtx, const AVCodecDescriptor *desc = avcodec_descriptor_get(stream->codecpar->codec_id); if (desc != NULL) { - meta_line_t *meta_audio = malloc(sizeof(meta_line_t)); - meta_audio->key = MetaMediaAudioCodec; - strcpy(meta_audio->str_val, desc->name); - APPEND_META(doc, meta_audio) + APPEND_STR_META(doc, MetaMediaAudioCodec, desc->name) } append_audio_meta(pFormatCtx, doc); @@ -263,10 +260,7 @@ void parse_media_format_ctx(scan_media_ctx_t *ctx, AVFormatContext *pFormatCtx, if (desc != NULL) { - meta_line_t *meta_vid = malloc(sizeof(meta_line_t)); - meta_vid->key = MetaMediaVideoCodec; - strcpy(meta_vid->str_val, desc->name); - APPEND_META(doc, meta_vid) + APPEND_STR_META(doc, MetaMediaVideoCodec, desc->name) } meta_line_t *meta_w = malloc(sizeof(meta_line_t));