On Mon, 4 Jan 2021, Nicolas Gaullier wrote:

De : Nicolas Gaullier <nicolas.gaullier@cji.paris> Envoyé : mardi 15 décembre 2020 18:13
À : ffmpeg-devel@ffmpeg.org
Cc : Nicolas Gaullier <nicolas.gaullier@cji.paris>
Objet : [PATCH] avcodec/dolby_e: set constant frame_size

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.

I am not sure I understand this. It is suprising that you say that frame_size cannot be set in dolby_e_init(), why does it matter? It can only be FRAME_SAMPLES, no other values can happen. In that sense it is similar to sample_fmt, which I also don't see why it is set in every decode call, and not only once, in init.

---
libavcodec/dolby_e.c | 1 +
1 file changed, 1 insertion(+)

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 you still believe that setting this is required in every decode call, then I'd say it would be cleaner to set this at dolby_e_decode_frame where other avctx parameters are also set.

Thanks,
Marton

    if ((ret = ff_get_buffer(s->avctx, frame, 0)) < 0)
        return ret;

--
2.27.0.windows.1

Hello,
Just a ping for this little patch
Thx
Nicolas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to