[FFmpeg-devel] [PATCH] avcodec/adpcm: also squelch 'mismatch in coded sample count' warning for AV_CODEC_ID_ADPCM_EA_R1

Peter Ross pross at xvid.org
Mon Mar 31 12:56:43 CEST 2014


AV_CODEC_ID_ADPCM_EA_R1/R2/R3 all use an internal offset. For some
samples there is padding between the offset table and ADPCM data.

Signed-off-by: Peter Ross <pross at xvid.org>
---
 libavcodec/adpcm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index f7f8259..e31242f 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -555,17 +555,16 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
         case AV_CODEC_ID_ADPCM_EA_R2:
             header_size    = 4 + 5 * ch;
             *coded_samples = bytestream2_get_le32(gb);
-            *approx_nb_samples = 1;
             break;
         case AV_CODEC_ID_ADPCM_EA_R3:
             header_size    = 4 + 5 * ch;
             *coded_samples = bytestream2_get_be32(gb);
-            *approx_nb_samples = 1;
             break;
         }
         *coded_samples -= *coded_samples % 28;
         nb_samples      = (buf_size - header_size) * 2 / ch;
         nb_samples     -= nb_samples % 28;
+        *approx_nb_samples = 1;
         break;
     case AV_CODEC_ID_ADPCM_IMA_DK3:
         if (avctx->block_align > 0)
-- 
1.8.3.2

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140331/b08f9b87/attachment.asc>


More information about the ffmpeg-devel mailing list