summaryrefslogtreecommitdiffstats
path: root/libhb/muxavformat.c
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2016-07-18 13:42:25 -0700
committerBradley Sepos <[email protected]>2016-09-02 03:33:06 -0400
commitfb78eca4a49077c171ad78177c1615c205adc642 (patch)
treea74bd30ca1ab0f67e4a37c0c728273d87dc57635 /libhb/muxavformat.c
parente7a320cb6223a2389db025e8bd8001ee9ece9769 (diff)
contrib: Add opus audio encoder.
Remove: hb_audio_samplerate_get_best() Add: hb_audio_samplerate_is_supported() hb_audio_samplerate_find_closest() hb_audio_samplerate_get_sr_shift()
Diffstat (limited to 'libhb/muxavformat.c')
-rw-r--r--libhb/muxavformat.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/libhb/muxavformat.c b/libhb/muxavformat.c
index b7533d4dc..47762721c 100644
--- a/libhb/muxavformat.c
+++ b/libhb/muxavformat.c
@@ -485,6 +485,23 @@ static int avformatInit( hb_mux_object_t * m )
size += ogg_headers[jj]->bytes;
}
} break;
+ case HB_ACODEC_OPUS:
+ track->st->codec->codec_id = AV_CODEC_ID_OPUS;
+
+ if (audio->priv.config.extradata.length)
+ {
+ priv_size = audio->priv.config.extradata.length;
+ priv_data = av_malloc(priv_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ if (priv_data == NULL)
+ {
+ hb_error("OPUS extradata: malloc failure");
+ goto error;
+ }
+ memcpy(priv_data,
+ audio->priv.config.extradata.bytes,
+ audio->priv.config.extradata.length);
+ }
+ break;
case HB_ACODEC_FFFLAC:
case HB_ACODEC_FFFLAC24:
track->st->codec->codec_id = AV_CODEC_ID_FLAC;