diff options
author | Anton Khirnov <anton@khirnov.net> | 2014-11-14 13:53:48 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2015-01-27 09:22:33 +0100 |
commit | a536a4e4bc52d05f59869761337452fb1f1977f6 (patch) | |
tree | 86a9fbbf9bc3d088b6645766f6c59af757b54633 /libavcodec | |
parent | 32125781487411ed3b1b28b32063d6cd4024d4fc (diff) | |
download | ffmpeg-a536a4e4bc52d05f59869761337452fb1f1977f6.tar.gz |
lavc: support extracting audio service type from side data
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/utils.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 5493055946..a36e96087e 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1397,6 +1397,13 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx, frame = &tmp; } + /* extract audio service type metadata */ + if (frame) { + AVFrameSideData *sd = av_frame_get_side_data(frame, AV_FRAME_DATA_AUDIO_SERVICE_TYPE); + if (sd && sd->size >= sizeof(enum AVAudioServiceType)) + avctx->audio_service_type = *(enum AVAudioServiceType*)sd->data; + } + /* check for valid frame size */ if (frame) { if (avctx->codec->capabilities & CODEC_CAP_SMALL_LAST_FRAME) { |