You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avformat/argo_asf: add name option
Reviewed-by: Alexander Strasser <eclipse7@gmx.net> Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
This commit is contained in:
@@ -68,6 +68,7 @@ typedef struct ArgoASFMuxContext {
|
|||||||
const AVClass *class;
|
const AVClass *class;
|
||||||
int version_major;
|
int version_major;
|
||||||
int version_minor;
|
int version_minor;
|
||||||
|
const char *name;
|
||||||
} ArgoASFMuxContext;
|
} ArgoASFMuxContext;
|
||||||
|
|
||||||
#if CONFIG_ARGO_ASF_DEMUXER
|
#if CONFIG_ARGO_ASF_DEMUXER
|
||||||
@@ -328,7 +329,10 @@ static int argo_asf_write_header(AVFormatContext *s)
|
|||||||
fhdr.version_minor = (uint16_t)ctx->version_minor;
|
fhdr.version_minor = (uint16_t)ctx->version_minor;
|
||||||
fhdr.num_chunks = 1;
|
fhdr.num_chunks = 1;
|
||||||
fhdr.chunk_offset = ASF_FILE_HEADER_SIZE;
|
fhdr.chunk_offset = ASF_FILE_HEADER_SIZE;
|
||||||
strncpy(fhdr.name, av_basename(s->url), FF_ARRAY_ELEMS(fhdr.name));
|
if (ctx->name)
|
||||||
|
strncpy(fhdr.name, ctx->name, sizeof(fhdr.name));
|
||||||
|
else
|
||||||
|
strncpy(fhdr.name, av_basename(s->url), sizeof(fhdr.name));
|
||||||
|
|
||||||
chdr.num_blocks = 0;
|
chdr.num_blocks = 0;
|
||||||
chdr.num_samples = ASF_SAMPLE_COUNT;
|
chdr.num_samples = ASF_SAMPLE_COUNT;
|
||||||
@@ -389,6 +393,14 @@ static const AVOption argo_asf_options[] = {
|
|||||||
.max = UINT16_MAX,
|
.max = UINT16_MAX,
|
||||||
.flags = AV_OPT_FLAG_ENCODING_PARAM
|
.flags = AV_OPT_FLAG_ENCODING_PARAM
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.name = "name",
|
||||||
|
.help = "embedded file name (max 8 characters)",
|
||||||
|
.offset = offsetof(ArgoASFMuxContext, name),
|
||||||
|
.type = AV_OPT_TYPE_STRING,
|
||||||
|
.default_val = {.str = NULL},
|
||||||
|
.flags = AV_OPT_FLAG_ENCODING_PARAM
|
||||||
|
},
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user