[FFmpeg-devel] [PATCH 1/4] lavc: do not override format is neither text nor bitmap codec prop is set

Marton Balint cus at passwd.hu
Sat Jul 27 21:14:44 CEST 2013


Some decoders may output both, this way the decoder can set it.

Signed-off-by: Marton Balint <cus at passwd.hu>
---
 libavcodec/utils.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 50448b4..8464c3b 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -2337,7 +2337,10 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
 
                 av_free_packet(&pkt_recoded);
             }
-            sub->format = !(avctx->codec_descriptor->props & AV_CODEC_PROP_BITMAP_SUB);
+            if (avctx->codec_descriptor->props & AV_CODEC_PROP_BITMAP_SUB)
+                sub->format = 0;
+            else if (avctx->codec_descriptor->props & AV_CODEC_PROP_TEXT_SUB)
+                sub->format = 1;
             avctx->pkt = NULL;
         }
 
-- 
1.8.1.4



More information about the ffmpeg-devel mailing list