]> git.sesse.net Git - ffmpeg/commitdiff
lavc/mlpdec: reset layout when channels change.
authorNicolas George <nicolas.george@normalesup.org>
Wed, 28 Nov 2012 14:25:39 +0000 (15:25 +0100)
committerNicolas George <nicolas.george@normalesup.org>
Sat, 8 Dec 2012 09:12:38 +0000 (10:12 +0100)
Triggered by the sample for trac ticket #1726.

libavcodec/mlpdec.c

index 753fff11ea20d494c0bb734269db9d9608f5fd11..c7de13c15c8db74d1837196e1e5cf5c7e8914efd 100644 (file)
@@ -524,8 +524,11 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp,
         cp->huff_lsbs        = 24;
     }
 
-    if (substr == m->max_decoded_substream)
+    if (substr == m->max_decoded_substream &&
+        m->avctx->channels != s->max_matrix_channel + 1) {
         m->avctx->channels = s->max_matrix_channel + 1;
+        m->avctx->channel_layout = 0;
+    }
 
     return 0;
 }