[FFmpeg-devel] [PATCH] libavformat/dashenc.c:make a sample Latency element

James Almer jamrial at gmail.com
Fri May 29 15:40:11 EEST 2020


On 5/29/2020 4:19 AM, Siyuan Huang wrote:
> according iso 23009-1 4th , one Latency element should contain
> 
> referenceId , target , max ,min atrributes
> 
>  
> 
> Signed-off-by: SiyuanHuang <saber.huang at samsung.com>
> 
> ---
> 
> libavformat/dashenc.c | 2 +-
> 
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
>  
> 
> diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
> 
> index f71c1364b4..df081ce3ef 100755
> 
> --- a/libavformat/dashenc.c
> 
> +++ b/libavformat/dashenc.c
> 
> @@ -1211,7 +1211,7 @@ static int write_manifest(AVFormatContext *s, int
> final)
> 
>      avio_printf(out, "\t<ServiceDescription id=\"0\">\n");
> 
>      if (!final && c->target_latency && c->target_latency_refid >= 0) {
> 
> -        avio_printf(out, "\t\t<Latency target=\"%"PRId64"\"",
> c->target_latency / 1000);
> 
> +        avio_printf(out, "\t\t<Latency referenceId=\"0\" target=\"%" PRId64
> "\" max=\"3000\" min=\"1000\"", c->target_latency / 1000);

referenceId is already applied below. It's only needed when there's more
than one stream using prft, so this is an unnecessary hardcoded duplicate.

min/max are both optional, and if you hardcode them like this, you'd end
up with an invalid mpd if the user were to set target_latency to for
example 4. So if you still want them in, make them configurable with the
required range checks.

> 
>          if (s->nb_streams > 1)
> 
>              avio_printf(out, " referenceId=\"%d\"",
> c->target_latency_refid);
> 
>          avio_printf(out, "/>\n");
> 



More information about the ffmpeg-devel mailing list