Quoting James Almer (2016-11-02 21:02:30)
> aac_adtstoasc makes the aac extradata available only after the first packet
> is filtered, and as packet side data.
> 
> Assume extradata will be available as part of the first packet if
> avpriv_mpeg4audio_get_config() fails the first time due to missing extradata
> and reserve space for the OutputSampleRate element in the Tracks master.
> 
> Signed-off-by: James Almer <jamr...@gmail.com>
> ---
> No functionality change compared to the previous versio, just some refactoring
> to better accommodate the following patch.
> 
>  libavformat/matroskaenc.c | 78 
> +++++++++++++++++++++++++++++++++++++++++++----
>  1 file changed, 72 insertions(+), 6 deletions(-)
> 
> diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
> index cfced72..68c91fa 100644
> --- a/libavformat/matroskaenc.c
> +++ b/libavformat/matroskaenc.c
> @@ -98,6 +98,8 @@ typedef struct MatroskaMuxContext {
>      int64_t         cluster_pts;
>      int64_t         duration_offset;
>      int64_t         duration;
> +    int64_t         sample_rate_offset;
> +    int             sample_rate;

This assumes there is at most one AAC track in the file, which is not
necessarily true. From a quick glance it seems to be rather
straigtforward to just move this to the per-track context.

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to