[MPlayer-dev-eng] [PATCH] Handle AV_CODEC_ID_SUBRIP subtitles

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Aug 19 21:39:23 CEST 2012


On Sun, Aug 19, 2012 at 10:52:10AM -0700, Philip Langdale wrote:
> On Sun, 19 Aug 2012 07:33:45 +0000 (UTC)
> Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
> 
> > Philip Langdale <philipl <at> overt.org> writes:
> > 
> > > +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 53, 100)
> > 
> > MPlayer at any time only supports current FFmpeg, 
> > so this is unneeded.
> 
> A good point. I was following the EIA608 test below.
> 
> Updated diff attached.
> 
> --phil

> Index: libmpdemux/demux_lavf.c
> ===================================================================
> --- libmpdemux/demux_lavf.c	(revision 35107)
> +++ libmpdemux/demux_lavf.c	(working copy)
> @@ -429,6 +429,8 @@
>              char type;
>              if(codec->codec_id == CODEC_ID_TEXT)
>                  type = 't';
> +            else if(codec->codec_id == AV_CODEC_ID_SUBRIP)
> +                type = 't';

Which would make it a reasonable simplification to just at this via ||

> @@ -812,7 +814,9 @@
>                              prog->aid = program->stream_index[i];
>                          break;
>                      case AVMEDIA_TYPE_SUBTITLE:
> -                        if(prog->sid == -2 && priv->avfc->streams[program->stream_index[i]]->codec->codec_id == CODEC_ID_TEXT)
> +                        if(prog->sid == -2 &&
> +                           (priv->avfc->streams[program->stream_index[i]]->codec->codec_id == CODEC_ID_TEXT ||
> +                            priv->avfc->streams[program->stream_index[i]]->codec->codec_id == AV_CODEC_ID_SUBRIP))

I guess it's fine, though I am tempted to just remove that condition
completely.


More information about the MPlayer-dev-eng mailing list