[MPlayer-cvslog] r38373 - in trunk/libmpcodecs: ad_ffmpeg.c dec_audio.c

reimar subversion at mplayerhq.hu
Sun Aug 7 21:20:48 EEST 2022


Author: reimar
Date: Sun Aug  7 21:20:48 2022
New Revision: 38373

Log:
dec_audio: support explicitly requesting more input data.

Fixes decoding of some MPEG-TS streams with DTS.

Modified:
   trunk/libmpcodecs/ad_ffmpeg.c
   trunk/libmpcodecs/dec_audio.c

Modified: trunk/libmpcodecs/ad_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/ad_ffmpeg.c	Sun Aug  7 21:20:47 2022	(r38372)
+++ trunk/libmpcodecs/ad_ffmpeg.c	Sun Aug  7 21:20:48 2022	(r38373)
@@ -333,6 +333,8 @@ static int decode_audio(sh_audio_t *sh_a
 	    int in_size = x;
 	    int consumed = ds_parse(sh_audio->ds, &start, &x, pts, 0);
 	    sh_audio->ds->buffer_pos -= in_size - consumed;
+	    // Explicitly request more data if all was used up by parser
+	    if (x == 0 && consumed == in_size && len == -1) len = AVERROR(EAGAIN);
 	    // Note: hopefully the following x <= 0 handling is correct, it was only
 	    // added because FFmpeg broke the API and 0-sized
 	    // packets started to break e.g. AC3 decode.

Modified: trunk/libmpcodecs/dec_audio.c
==============================================================================
--- trunk/libmpcodecs/dec_audio.c	Sun Aug  7 21:20:47 2022	(r38372)
+++ trunk/libmpcodecs/dec_audio.c	Sun Aug  7 21:20:48 2022	(r38373)
@@ -410,7 +410,8 @@ static int filter_n_bytes(sh_audio_t *sh
 	int format_change = sh->samplerate != filter_input.rate ||
 	                    sh->channels != filter_input.nch ||
 	                    sh->sample_format != filter_input.format;
-	if (ret <= 0 || format_change) {
+	if (ret == AVERROR(EAGAIN)) ret = 0;
+	else if (ret <= 0 || format_change) {
 	    error = format_change ? -2 : -1;
 	    len = sh->a_buffer_len;
 	    break;


More information about the MPlayer-cvslog mailing list