summaryrefslogtreecommitdiff
path: root/libavformat/mov_chan.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2012-09-07 10:45:16 +0300
committerMartin Storsjö <martin@martin.st>2012-09-08 01:30:44 +0300
commit7b699d813681e4fad419ec63c96d595e98b2dbfa (patch)
tree657b004bec4559803a487f50a8967c1d6779e71c /libavformat/mov_chan.c
parent5f72bc02f8ee7ccbdf779f560a11e9f228b7ac82 (diff)
mov_chan: Only set the channel_layout if setting it to a nonzero value
If regularly parsing new chan atoms (as in rtpdec_qt), but the chan atoms don't actually contain any channel layout, don't reset the value that the caller has filled in (by guessing). Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/mov_chan.c')
-rw-r--r--libavformat/mov_chan.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c
index b1fa13f753..00a2a4bb92 100644
--- a/libavformat/mov_chan.c
+++ b/libavformat/mov_chan.c
@@ -579,9 +579,10 @@ int ff_mov_read_chan(AVFormatContext *s, AVIOContext *pb, AVStream *st,
label_mask |= mask_incr;
}
}
- if (layout_tag == 0)
- st->codec->channel_layout = label_mask;
- else
+ if (layout_tag == 0) {
+ if (label_mask)
+ st->codec->channel_layout = label_mask;
+ } else
st->codec->channel_layout = ff_mov_get_channel_layout(layout_tag, bitmap);
return 0;