[FFmpeg-cvslog] lavf/swfdec: support 8-bits PCM audio.

Clément Bœsch git at videolan.org
Wed Feb 20 22:06:16 CET 2013


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Wed Feb 20 21:43:55 2013 +0100| [624fb5f96544fd39d69abc5cadbba3f801d673b1] | committer: Clément Bœsch

lavf/swfdec: support 8-bits PCM audio.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=624fb5f96544fd39d69abc5cadbba3f801d673b1
---

 libavformat/swfdec.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c
index 9e243f5..5f64995 100644
--- a/libavformat/swfdec.c
+++ b/libavformat/swfdec.c
@@ -140,7 +140,7 @@ static int swf_read_header(AVFormatContext *s)
 
 static AVStream *create_new_audio_stream(AVFormatContext *s, int id, int info)
 {
-    int sample_rate_code;
+    int sample_rate_code, sample_size_code;
     AVStream *ast = avformat_new_stream(s, NULL);
     if (!ast)
         return NULL;
@@ -156,6 +156,9 @@ static AVStream *create_new_audio_stream(AVFormatContext *s, int id, int info)
     ast->codec->codec_id   = ff_codec_get_id(swf_audio_codec_tags, info>>4 & 15);
     ast->need_parsing = AVSTREAM_PARSE_FULL;
     sample_rate_code = info>>2 & 3;
+    sample_size_code = info>>1 & 1;
+    if (!sample_size_code && ast->codec->codec_id == AV_CODEC_ID_PCM_S16LE)
+        ast->codec->codec_id = AV_CODEC_ID_PCM_U8;
     ast->codec->sample_rate = 44100 >> (3 - sample_rate_code);
     avpriv_set_pts_info(ast, 64, 1, ast->codec->sample_rate);
     return ast;



More information about the ffmpeg-cvslog mailing list