Signed-off-by: Zane van Iperen <z...@zanevaniperen.com>
---
 libavformat/argo_asf.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/libavformat/argo_asf.c b/libavformat/argo_asf.c
index 9845cb955b..3499519903 100644
--- a/libavformat/argo_asf.c
+++ b/libavformat/argo_asf.c
@@ -69,6 +69,7 @@ typedef struct ArgoASFContext {
     ArgoASFFileHeader   fhdr;
     ArgoASFChunkHeader  ckhdr;
     uint32_t            blocks_read;
+    const char         *name;
 } ArgoASFContext;
 
 #if CONFIG_ARGO_ASF_DEMUXER
@@ -301,7 +302,10 @@ static int argo_asf_write_header(AVFormatContext *s)
     /* version_{major,minor} set by options. */
     ctx->fhdr.num_chunks         = 1;
     ctx->fhdr.chunk_offset       = ASF_FILE_HEADER_SIZE;
-    strncpy(ctx->fhdr.name, av_basename(s->url), 
FF_ARRAY_ELEMS(ctx->fhdr.name));
+    if (ctx->name)
+        strncpy(ctx->fhdr.name, ctx->name, FF_ARRAY_ELEMS(ctx->fhdr.name));
+    else
+        strncpy(ctx->fhdr.name, av_basename(s->url), 
FF_ARRAY_ELEMS(ctx->fhdr.name));
 
     ctx->ckhdr.num_blocks        = 0;
     ctx->ckhdr.num_samples       = ASF_SAMPLE_COUNT;
@@ -362,6 +366,14 @@ static const AVOption argo_asf_options[] = {
         .max         = UINT16_MAX,
         .flags       = AV_OPT_FLAG_ENCODING_PARAM
     },
+    {
+        .name        = "name",
+        .help        = "embedded file name (max 8 characters)",
+        .offset      = offsetof(ArgoASFContext, name),
+        .type        = AV_OPT_TYPE_STRING,
+        .default_val = {.str = NULL},
+        .flags       = AV_OPT_FLAG_ENCODING_PARAM
+    },
     { NULL }
 };
 
-- 
2.25.1


_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to