| OLD | NEW |
| 1 /* | 1 /* |
| 2 * MPEG-4 Audio common code | 2 * MPEG-4 Audio common code |
| 3 * Copyright (c) 2008 Baptiste Coudurier <baptiste.coudurier@free.fr> | 3 * Copyright (c) 2008 Baptiste Coudurier <baptiste.coudurier@free.fr> |
| 4 * Copyright (c) 2009 Alex Converse <alex.converse@gmail.com> | 4 * Copyright (c) 2009 Alex Converse <alex.converse@gmail.com> |
| 5 * | 5 * |
| 6 * This file is part of FFmpeg. | 6 * This file is part of FFmpeg. |
| 7 * | 7 * |
| 8 * FFmpeg is free software; you can redistribute it and/or | 8 * FFmpeg is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 GetBitContext gb; | 81 GetBitContext gb; |
| 82 int specific_config_bitindex; | 82 int specific_config_bitindex; |
| 83 | 83 |
| 84 init_get_bits(&gb, buf, buf_size*8); | 84 init_get_bits(&gb, buf, buf_size*8); |
| 85 c->object_type = get_object_type(&gb); | 85 c->object_type = get_object_type(&gb); |
| 86 c->sample_rate = get_sample_rate(&gb, &c->sampling_index); | 86 c->sample_rate = get_sample_rate(&gb, &c->sampling_index); |
| 87 c->chan_config = get_bits(&gb, 4); | 87 c->chan_config = get_bits(&gb, 4); |
| 88 if (c->chan_config < FF_ARRAY_ELEMS(ff_mpeg4audio_channels)) | 88 if (c->chan_config < FF_ARRAY_ELEMS(ff_mpeg4audio_channels)) |
| 89 c->channels = ff_mpeg4audio_channels[c->chan_config]; | 89 c->channels = ff_mpeg4audio_channels[c->chan_config]; |
| 90 c->sbr = -1; | 90 c->sbr = -1; |
| 91 if (c->object_type == AOT_SBR) { | 91 if (c->object_type == AOT_SBR || (c->object_type == AOT_PS && |
| 92 // check for W6132 Annex YYYY draft MP3onMP4 |
| 93 !(show_bits(&gb, 3) & 0x03 && !(show_bits(&gb, 9) & 0x3F)))) { |
| 92 c->ext_object_type = c->object_type; | 94 c->ext_object_type = c->object_type; |
| 93 c->sbr = 1; | 95 c->sbr = 1; |
| 94 c->ext_sample_rate = get_sample_rate(&gb, &c->ext_sampling_index); | 96 c->ext_sample_rate = get_sample_rate(&gb, &c->ext_sampling_index); |
| 95 c->object_type = get_object_type(&gb); | 97 c->object_type = get_object_type(&gb); |
| 96 if (c->object_type == AOT_ER_BSAC) | 98 if (c->object_type == AOT_ER_BSAC) |
| 97 c->ext_chan_config = get_bits(&gb, 4); | 99 c->ext_chan_config = get_bits(&gb, 4); |
| 98 } else { | 100 } else { |
| 99 c->ext_object_type = AOT_NULL; | 101 c->ext_object_type = AOT_NULL; |
| 100 c->ext_sample_rate = 0; | 102 c->ext_sample_rate = 0; |
| 101 } | 103 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 if (bits) | 162 if (bits) |
| 161 copy_bits(pb, gb, bits); | 163 copy_bits(pb, gb, bits); |
| 162 align_put_bits(pb); | 164 align_put_bits(pb); |
| 163 align_get_bits(gb); | 165 align_get_bits(gb); |
| 164 comment_size = copy_bits(pb, gb, 8); | 166 comment_size = copy_bits(pb, gb, 8); |
| 165 for (; comment_size > 0; comment_size--) | 167 for (; comment_size > 0; comment_size--) |
| 166 copy_bits(pb, gb, 8); | 168 copy_bits(pb, gb, 8); |
| 167 | 169 |
| 168 return put_bits_count(pb) - offset; | 170 return put_bits_count(pb) - offset; |
| 169 } | 171 } |
| OLD | NEW |