1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00

lavc: support extracting audio service type from side data

This commit is contained in:
Anton Khirnov 2014-11-14 13:53:48 +01:00
parent 3212578148
commit a536a4e4bc

View File

@ -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) {