> 2021年10月20日 上午10:38,[email protected] 写道:
> 
> From: xutopia <[email protected]>
> 
> Signed-off-by: xutopia <[email protected]>
> ---
> libavformat/mov.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index 57c67e3aac..9673234734 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -521,7 +521,17 @@ retry:
>             str[str_size] = 0;
>         }
>         c->fc->event_flags |= AVFMT_EVENT_FLAG_METADATA_UPDATED;
> -        av_dict_set(&c->fc->metadata, key, str, 0);
> +
> +        if (c->trak_index >= 0) {
> +            if (c->trak_index < c->fc->nb_streams) {
> +                av_dict_set(&c->fc->streams[c->trak_index]->metadata, key, 
> str, 0);
> +            } else {
> +                av_log(c->fc, AV_LOG_ERROR, "current trck idx=%d > 
> streams=%d\n", c->trak_index, c->fc->nb_streams);
The message looks is used for debug, it is? It should use AV_LOG_DEBUG if yes.
> +            }
> +        } else {
> +            av_dict_set(&c->fc->metadata, key, str, 0);
> +        }
> +        
>         if (*language && strcmp(language, "und")) {
>             snprintf(key2, sizeof(key2), "%s-%s", key, language);
>             av_dict_set(&c->fc->metadata, key2, str, 0);
> -- 
> 2.25.1
> 
> _______________________________________________
> ffmpeg-devel mailing list
> [email protected]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> [email protected] with subject "unsubscribe".
> 

Thanks

Steven Liu

_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to