On Fri, 20 Mar 2015 16:47:57 -0600
John Stebbins <[email protected]> wrote:

> Some subtitles (e.g. PGS) do not require a duration since they have
> explicit end-of-subtitle indication in the stream.  This provides
> a way to omit the unnecessary duration while muxing.
> ---
>  libavformat/matroskaenc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
> index 49e5bf3..1dd8d74 100644
> --- a/libavformat/matroskaenc.c
> +++ b/libavformat/matroskaenc.c
> @@ -1524,7 +1524,8 @@ static int mkv_write_packet_internal(AVFormatContext 
> *s, AVPacket *pkt)
>                                                     
> mkv_blockgroup_size(pkt->size));
>          duration = pkt->convergence_duration;
>          mkv_write_block(s, pb, MATROSKA_ID_BLOCK, pkt, 0);
> -        put_ebml_uint(pb, MATROSKA_ID_BLOCKDURATION, duration);
> +        if (pkt->convergence_duration != AV_NOPTS_VALUE)
> +            put_ebml_uint(pb, MATROSKA_ID_BLOCKDURATION, duration);
>          end_ebml_master(pb, blockgroup);
>      }
>  

It's weird that it checks convergence_duration when writing duration. I
also wasn't aware that convergence_duration can be set to AV_NOPTS_VALUE
to signal that it's unset. Isn't 0 the value for unset duration? (The
API can't distinguish between 0 duration and unset duration, this is a
known problem.)
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to