[vlc-commits] AVcodec: use avctx width for subtitles when set

Jean-Baptiste Kempf git at videolan.org
Tue May 20 15:02:15 CEST 2014


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue May 20 14:58:40 2014 +0200| [ba02909b221d38fc554bb7835557346ed53d3294] | committer: Jean-Baptiste Kempf

AVcodec: use avctx width for subtitles when set

Instead of hardcoding it depending on the codec

Tested with PGS and XSub

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

 modules/codec/avcodec/subtitle.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/codec/avcodec/subtitle.c b/modules/codec/avcodec/subtitle.c
index adac097..a8bb19f 100644
--- a/modules/codec/avcodec/subtitle.c
+++ b/modules/codec/avcodec/subtitle.c
@@ -249,7 +249,7 @@ static subpicture_t *ConvertSubtitle(decoder_t *dec, AVSubtitle *ffsub, mtime_t
     spu->b_absolute = true; /* FIXME How to set it right ? */
     spu->b_ephemer  = true; /* FIXME How to set it right ? */
 
-    if (avctx->codec_id == AV_CODEC_ID_HDMV_PGS_SUBTITLE) {
+    if (avctx->coded_width != 0 && avctx->coded_height != 0) {
         spu->i_original_picture_width = avctx->coded_width;
         spu->i_original_picture_height = avctx->coded_height;
     } else {



More information about the vlc-commits mailing list