~ubuntu-branches/ubuntu/trusty/libav/trusty

« back to all changes in this revision

Viewing changes to libavcodec/mlp_parser.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler, Jonas Smedegaard, Reinhard Tartler
  • Date: 2013-03-02 14:34:27 UTC
  • mfrom: (1.5.6)
  • mto: (1.3.35 sid)
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: package-import@ubuntu.com-20130302143427-wdmprnbkkccte051
Tags: 6:9.3-1
[ Jonas Smedegaard ]
* Stop using CDBS.

[ Reinhard Tartler ]
* Imported Upstream version 9.2 (never uploaded, though)
* Imported Upstream version 9.3:
  - Fixes CVE-2013-0894
* drop 02-fix-build-on-non-armv5te.patch, merged upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
126
126
 
127
127
int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh, GetBitContext *gb)
128
128
{
129
 
    int ratebits;
 
129
    int ratebits, channel_arrangement;
130
130
    uint16_t checksum;
131
131
 
132
132
    assert(get_bits_count(gb) == 0);
157
157
 
158
158
        skip_bits(gb, 11);
159
159
 
160
 
        mh->channels_mlp = get_bits(gb, 5);
 
160
        channel_arrangement    = get_bits(gb, 5);
 
161
        mh->channels_mlp       = mlp_channels[channel_arrangement];
 
162
        mh->channel_layout_mlp = mlp_layout[channel_arrangement];
161
163
    } else if (mh->stream_type == 0xba) {
162
164
        mh->group1_bits = 24; // TODO: Is this information actually conveyed anywhere?
163
165
        mh->group2_bits = 0;
168
170
 
169
171
        skip_bits(gb, 8);
170
172
 
171
 
        mh->channels_thd_stream1 = get_bits(gb, 5);
 
173
        channel_arrangement            = get_bits(gb, 5);
 
174
        mh->channels_thd_stream1       = truehd_channels(channel_arrangement);
 
175
        mh->channel_layout_thd_stream1 = truehd_layout(channel_arrangement);
172
176
 
173
177
        skip_bits(gb, 2);
174
178
 
175
 
        mh->channels_thd_stream2 = get_bits(gb, 13);
 
179
        channel_arrangement            = get_bits(gb, 13);
 
180
        mh->channels_thd_stream2       = truehd_channels(channel_arrangement);
 
181
        mh->channel_layout_thd_stream2 = truehd_layout(channel_arrangement);
176
182
    } else
177
183
        return AVERROR_INVALIDDATA;
178
184
 
316
322
 
317
323
        if (mh.stream_type == 0xbb) {
318
324
            /* MLP stream */
319
 
            avctx->channels = mlp_channels[mh.channels_mlp];
320
 
            avctx->channel_layout = mlp_layout[mh.channels_mlp];
 
325
            avctx->channels       = mh.channels_mlp;
 
326
            avctx->channel_layout = mh.channel_layout_mlp;
321
327
        } else { /* mh.stream_type == 0xba */
322
328
            /* TrueHD stream */
323
329
            if (mh.channels_thd_stream2) {
324
 
                avctx->channels = truehd_channels(mh.channels_thd_stream2);
325
 
                avctx->channel_layout = truehd_layout(mh.channels_thd_stream2);
 
330
                avctx->channels       = mh.channels_thd_stream2;
 
331
                avctx->channel_layout = mh.channel_layout_thd_stream2;
326
332
            } else {
327
 
                avctx->channels = truehd_channels(mh.channels_thd_stream1);
328
 
                avctx->channel_layout = truehd_layout(mh.channels_thd_stream1);
 
333
                avctx->channels       = mh.channels_thd_stream1;
 
334
                avctx->channel_layout = mh.channel_layout_thd_stream1;
329
335
            }
330
336
        }
331
337