[FFmpeg-cvslog] r20674 - in trunk/libavformat: aiff.h aiffdec.c

bcoudurier subversion
Mon Nov 30 23:01:21 CET 2009


Author: bcoudurier
Date: Mon Nov 30 23:01:21 2009
New Revision: 20674

Log:
decode qcelp in aiff, implement #1524, patch by Vitor

Modified:
   trunk/libavformat/aiff.h
   trunk/libavformat/aiffdec.c

Modified: trunk/libavformat/aiff.h
==============================================================================
--- trunk/libavformat/aiff.h	Mon Nov 30 22:43:03 2009	(r20673)
+++ trunk/libavformat/aiff.h	Mon Nov 30 23:01:21 2009	(r20674)
@@ -46,6 +46,7 @@ static const AVCodecTag ff_codec_aiff_ta
     { CODEC_ID_PCM_S16LE,    MKTAG('s','o','w','t') },
     { CODEC_ID_ADPCM_IMA_QT, MKTAG('i','m','a','4') },
     { CODEC_ID_QDM2,         MKTAG('Q','D','M','2') },
+    { CODEC_ID_QCELP,        MKTAG('Q','c','l','p') },
     { CODEC_ID_NONE,         0 },
 };
 

Modified: trunk/libavformat/aiffdec.c
==============================================================================
--- trunk/libavformat/aiffdec.c	Mon Nov 30 22:43:03 2009	(r20673)
+++ trunk/libavformat/aiffdec.c	Mon Nov 30 23:01:21 2009	(r20674)
@@ -127,6 +127,10 @@ static unsigned int get_aiff_header(Byte
             codec->block_align = 33;
             codec->frame_size = 160;
             break;
+        case CODEC_ID_QCELP:
+            codec->block_align = 35;
+            codec->frame_size= 160;
+            break;
         default:
             break;
         }
@@ -284,7 +288,7 @@ static int aiff_read_packet(AVFormatCont
     AVStream *st = s->streams[0];
     AIFFInputContext *aiff = s->priv_data;
     int64_t max_size;
-    int res;
+    int res, size;
 
     /* calculate size of remaining data */
     max_size = aiff->data_end - url_ftell(s->pb);
@@ -292,8 +296,12 @@ static int aiff_read_packet(AVFormatCont
         return AVERROR_EOF;
 
     /* Now for that packet */
-    max_size = FFMIN(max_size, (MAX_SIZE / st->codec->block_align) * st->codec->block_align);
-    res = av_get_packet(s->pb, pkt, max_size);
+    if (st->codec->block_align >= 33) // GSM, QCLP, IMA4
+        size = st->codec->block_align;
+    else
+        size = (MAX_SIZE / st->codec->block_align) * st->codec->block_align;
+    size = FFMIN(max_size, size);
+    res = av_get_packet(s->pb, pkt, size);
     if (res < 0)
         return res;
 



More information about the ffmpeg-cvslog mailing list