On 04/09/15 21:58, wm4 wrote:
> The generic code in utils.c sets the AVFrame.pkt_dts field from the
> packet it was supposedly decoded. This does not have to be true for a
> fully asynchronous decoder like mmaldec. It could be overwritten with an
> incorrect value. Even if the decoder doesn't determine the DTS (but sets
> it to AV_NOPTS_VALUE), it's impossible to determine a correct value in
> utils.c.
> 
> Decoders can now be marked with AV_CODEC_CAP_DECODER_SETS_PKT_DTS, in
> which case utils.c won't overwrite the field. The decoders are expected
> to set this field (even if they only set it to AV_NOPTS_VALUE).
> 
> The new codec cap is not useful to API users, and exists only to work
> around internal libavcodec issues. Declare it private API. I've still
> put it into the public header to avoid that the constant is
> accidentally used twice.
> ---
>  libavcodec/avcodec.h | 5 +++++
>  libavcodec/utils.c   | 3 ++-
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 9b38655..6a95845 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -808,6 +808,11 @@ typedef struct RcOverride{
>   * Audio encoder supports receiving a different number of samples in each 
> call.
>   */
>  #define AV_CODEC_CAP_VARIABLE_FRAME_SIZE (1 << 16)
> +/**
> + * Decoder sets AVFrame.pkt_dts before returning from decode().
> + * Internal use only; this is not part of the public API.
> + */
> +#define AV_CODEC_CAP_DECODER_SETS_PKT_DTS (1 << 17)
>  

What about putting it in AVCodecInternal ?

lu

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

Reply via email to