* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "parser.h"
-
#include "dolby_e.h"
#include "get_bits.h"
#include "put_bits.h"
typedef struct DBEParseContext {
- ParseContext pc;
DBEContext dectx;
-
- DolbyEHeaderInfo metadata;
} DBEParseContext;
static int dolby_e_parse(AVCodecParserContext *s2, AVCodecContext *avctx,
DBEContext *s = &s1->dectx;
int ret;
- if ((ret = ff_dolby_e_parse_init(s, buf, buf_size)) < 0)
- goto end;
-
- if ((ret = ff_dolby_e_parse_header(s, &s1->metadata)) < 0)
+ if ((ret = ff_dolby_e_parse_header(s, buf, buf_size)) < 0)
goto end;
s2->duration = FRAME_SAMPLES;
- switch (s1->metadata.nb_channels) {
+ switch (s->metadata.nb_channels) {
case 4:
avctx->channel_layout = AV_CH_LAYOUT_4POINT0;
break;
break;
}
- avctx->channels = s1->metadata.nb_channels;
- avctx->sample_rate = sample_rate_tab[s1->metadata.fr_code];
+ avctx->channels = s->metadata.nb_channels;
+ avctx->sample_rate = s->metadata.sample_rate;
avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
end:
return buf_size;
}
-AVCodecParser ff_dolby_e_parser = {
+const AVCodecParser ff_dolby_e_parser = {
.codec_ids = { AV_CODEC_ID_DOLBY_E },
.priv_data_size = sizeof(DBEParseContext),
.parser_parse = dolby_e_parse,
- .parser_close = ff_parse_close,
};