[FFmpeg-cvslog] lavc: support extracting audio service type from side data

Anton Khirnov git at videolan.org
Tue Jan 27 19:10:56 CET 2015


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Fri Nov 14 13:53:48 2014 +0100| [a536a4e4bc52d05f59869761337452fb1f1977f6] | committer: Anton Khirnov

lavc: support extracting audio service type from side data

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a536a4e4bc52d05f59869761337452fb1f1977f6
---

 libavcodec/utils.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 5493055..a36e960 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) {



More information about the ffmpeg-cvslog mailing list