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

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Aug 18 23:58:23 CEST 2012


On Sat, Aug 18, 2012 at 02:50:01PM -0700, Philip Langdale wrote:
> +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 53, 100)
> +            else if(codec->codec_id == AV_CODEC_ID_SUBRIP)

Just define AV_CODEC_ID_SUBRIP as some nonsense for old versions,
this clutters the code too much..

> -                        if(prog->sid == -2 && priv->avfc->streams[program->stream_index[i]]->codec->codec_id == CODEC_ID_TEXT)
> +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 53, 100)
> +                        is_subrip = priv->avfc->streams[program->stream_index[i]]->codec->codec_id == AV_CODEC_ID_SUBRIP;
> +#endif
> +                        if(prog->sid == -2 &&
> +                           (priv->avfc->streams[program->stream_index[i]]->codec->codec_id == CODEC_ID_TEXT ||
> +                            is_subrip))
>                              prog->sid = program->stream_index[i];


Admittedly unrelated, but this is badly in need of cleanup/refactoring,
though more importantly: what is the point of that condition?
I have a feeling it should be removed.


More information about the MPlayer-dev-eng mailing list