lavc: do not override format if neither text nor bitmap codec prop is set
authorMarton Balint <cus@passwd.hu>
Sat, 27 Jul 2013 19:14:44 +0000 (21:14 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 27 Jul 2013 21:03:00 +0000 (23:03 +0200)
Some decoders may output both, this way the decoder can set it.

Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/utils.c

index 50448b4..8464c3b 100644 (file)
@@ -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;
         }