[FFmpeg-cvslog] iff: set channel layout

Justin Ruggles git at videolan.org
Tue Nov 13 11:00:18 CET 2012


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Sat Apr  7 14:05:45 2012 -0400| [024e03701c706d3976348b9f50a1af7db2137a39] | committer: Justin Ruggles

iff: set channel layout

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

 libavformat/iff.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/libavformat/iff.c b/libavformat/iff.c
index c2bc283..ab22e11 100644
--- a/libavformat/iff.c
+++ b/libavformat/iff.c
@@ -29,6 +29,7 @@
  * http://wiki.multimedia.cx/index.php?title=IFF
  */
 
+#include "libavutil/channel_layout.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/dict.h"
 #include "avformat.h"
@@ -120,6 +121,7 @@ static int iff_read_header(AVFormatContext *s)
         return AVERROR(ENOMEM);
 
     st->codec->channels = 1;
+    st->codec->channel_layout = AV_CH_LAYOUT_MONO;
     avio_skip(pb, 8);
     // codec_tag used by ByteRun1 decoder to distinguish progressive (PBM) and interlaced (ILBM) content
     st->codec->codec_tag = avio_rl32(pb);
@@ -154,7 +156,13 @@ static int iff_read_header(AVFormatContext *s)
         case ID_CHAN:
             if (data_size < 4)
                 return AVERROR_INVALIDDATA;
-            st->codec->channels = (avio_rb32(pb) < 6) ? 1 : 2;
+            if (avio_rb32(pb) < 6) {
+                st->codec->channels       = 1;
+                st->codec->channel_layout = AV_CH_LAYOUT_MONO;
+            } else {
+                st->codec->channels       = 2;
+                st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
+            }
             break;
 
         case ID_CMAP:



More information about the ffmpeg-cvslog mailing list