1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avformat/argo_asf: use title metadata when muxing

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
This commit is contained in:
Zane van Iperen 2021-10-11 21:20:28 +10:00
parent 9a2b9aafba
commit 5d16660598
No known key found for this signature in database
GPG Key ID: 68616B2D8AC4DCC5

View File

@ -358,14 +358,22 @@ static int argo_asf_write_header(AVFormatContext *s)
.num_chunks = 1, .num_chunks = 1,
.chunk_offset = ASF_FILE_HEADER_SIZE .chunk_offset = ASF_FILE_HEADER_SIZE
}; };
const char *name = ctx->name, *end; AVDictionaryEntry *t;
const char *name, *end;
size_t len; size_t len;
/* /*
* If the user specified a name, use it as is. Otherwise take the * If the user specified a name, use it as is. Otherwise,
* basename and lop off the extension (if any). * try to use metadata (if present), then fall back to the
* filename (minus extension).
*/ */
if (name || !(end = strrchr((name = av_basename(s->url)), '.'))) { if (ctx->name) {
name = ctx->name;
len = strlen(ctx->name);
} else if ((t = av_dict_get(s->metadata, "title", NULL, 0))) {
name = t->value;
len = strlen(t->value);
} else if (!(end = strrchr((name = av_basename(s->url)), '.'))) {
len = strlen(name); len = strlen(name);
} else { } else {
len = end - name; len = end - name;