Merge remote-tracking branch 'cehoyos/master'
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 13 Dec 2013 14:44:39 +0000 (15:44 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 13 Dec 2013 14:44:45 +0000 (15:44 +0100)
* cehoyos/master:
  Force one stream in caf muxer.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/cafenc.c

index cd3a0be907f412b248b43d2e4dbe979d4ead9f47..ae36b85cb18adb39245d95025cae854f76df39fe 100644 (file)
@@ -108,6 +108,11 @@ static int caf_write_header(AVFormatContext *s)
     unsigned int codec_tag = ff_codec_get_tag(ff_codec_caf_tags, enc->codec_id);
     int64_t chunk_size = 0;
 
+    if (s->nb_streams != 1) {
+        av_log(s, AV_LOG_ERROR, "CAF files have exactly one stream\n");
+        return AVERROR(EINVAL);
+    }
+
     switch (enc->codec_id) {
     case AV_CODEC_ID_AAC:
     case AV_CODEC_ID_AC3: