[FFmpeg-devel] [PATCH v3 13/25] avcodec/utils: do_decode now supports AVMEDIA_TYPE_DATA
Erkki Seppälä
erkki.seppala.ext at nokia.com
Mon Sep 19 16:25:36 EEST 2016
This allows using avcodec_send_packet with data frames (ie. timed
metadata)
Signed-off-by: Erkki Seppälä <erkki.seppala.ext at nokia.com>
Signed-off-by: OZOPlayer <OZOPL at nokia.com>
---
libavcodec/utils.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 138125a..8b55464 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -2737,6 +2737,10 @@ static int do_decode(AVCodecContext *avctx, AVPacket *pkt)
} else if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) {
ret = avcodec_decode_audio4(avctx, avctx->internal->buffer_frame,
&got_frame, pkt);
+ } else if (avctx->codec_type == AVMEDIA_TYPE_DATA) {
+ ret = avctx->codec->decode(avctx, avctx->internal->buffer_frame, &got_frame, pkt);
+ if (ret == 0 && got_frame)
+ ret = pkt->size;
} else {
ret = AVERROR(EINVAL);
}
--
2.7.4
More information about the ffmpeg-devel
mailing list