diff options
author | Kieran Kunhya <kierank@obe.tv> | 2014-10-18 00:25:16 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2014-12-20 11:29:19 +0100 |
commit | 9cfa68c560bdec82d2d5ec079f9c5b0f9ca37af0 (patch) | |
tree | 6fbd13f5452daad0169f6d39548f4328a5ee5513 /libavcodec/opus.c | |
parent | 8ebf02f8f530240edf7e45f35f7647ef9dd44a58 (diff) | |
download | ffmpeg-9cfa68c560bdec82d2d5ec079f9c5b0f9ca37af0.tar.gz |
mpegts: add support for Opus
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/opus.c')
-rw-r--r-- | libavcodec/opus.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/libavcodec/opus.c b/libavcodec/opus.c index 91021ce65a..1bc417b477 100644 --- a/libavcodec/opus.c +++ b/libavcodec/opus.c @@ -290,10 +290,6 @@ av_cold int ff_opus_parse_extradata(AVCodecContext *avctx, OpusContext *s) { static const uint8_t default_channel_map[2] = { 0, 1 }; - uint8_t default_extradata[19] = { - 'O', 'p', 'u', 's', 'H', 'e', 'a', 'd', - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }; int (*channel_reorder)(int, int) = channel_reorder_unknown; @@ -308,9 +304,8 @@ av_cold int ff_opus_parse_extradata(AVCodecContext *avctx, "Multichannel configuration without extradata.\n"); return AVERROR(EINVAL); } - default_extradata[9] = (avctx->channels == 1) ? 1 : 2; - extradata = default_extradata; - extradata_size = sizeof(default_extradata); + extradata = opus_default_extradata; + extradata_size = sizeof(opus_default_extradata); } else { extradata = avctx->extradata; extradata_size = avctx->extradata_size; @@ -330,7 +325,7 @@ av_cold int ff_opus_parse_extradata(AVCodecContext *avctx, avctx->delay = AV_RL16(extradata + 10); - channels = extradata[9]; + channels = avctx->extradata ? extradata[9] : (avctx->channels == 1) ? 1 : 2; if (!channels) { av_log(avctx, AV_LOG_ERROR, "Zero channel count specified in the extadata\n"); return AVERROR_INVALIDDATA; |