diff mbox series

[FFmpeg-devel,v5,1/9] avcodec/dolby_e: set constant frame_size

Message ID 20201019081929.1926-2-nicolas.gaullier@cji.paris
State New
Headers show
Series avformat: wav-s337m support + new probe_stream option
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished

Commit Message

Nicolas Gaullier Oct. 19, 2020, 8:19 a.m. UTC
Fixes pts generation.

Setting frame_size in dolby_e_init() or get_audio_frame_duration()
can result in a bad duration value for the first packet if dolby_e is
muxed in a container having a different sample_rate (ex:
container @48KHz, DolbyE @44.8KHz).
Maybe adding a parser to dolby_e would fix the issue and makes it
possible to set frame_size at decoder init which seems the best place.
---
 libavcodec/dolby_e.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/libavcodec/dolby_e.c b/libavcodec/dolby_e.c
index 429612ec08..b0e6d6aee3 100644
--- a/libavcodec/dolby_e.c
+++ b/libavcodec/dolby_e.c
@@ -577,6 +577,7 @@  static int filter_frame(DBEContext *s, AVFrame *frame)
         reorder = ch_reorder_n;
 
     frame->nb_samples = FRAME_SAMPLES;
+    s->avctx->frame_size = FRAME_SAMPLES;
     if ((ret = ff_get_buffer(s->avctx, frame, 0)) < 0)
         return ret;