[vlc-devel] [PATCH] Map AV_CODEC_ID_ASS to VLC_CODEC_SSA
Zhao Zhili
quinkblack at foxmail.com
Thu Dec 27 03:39:20 CET 2018
On 2018/12/27 上午9:56, zhanghuicuc at 163.com wrote:
> From: Zhang Hui <zhanghui at formovie.cn>
>
> so we can use libass with avformat for ass subtitles
> ---
> modules/codec/avcodec/fourcc.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/modules/codec/avcodec/fourcc.c b/modules/codec/avcodec/fourcc.c
> index 40e98e0..5b22c55 100644
> --- a/modules/codec/avcodec/fourcc.c
> +++ b/modules/codec/avcodec/fourcc.c
> @@ -474,6 +474,9 @@ static const struct vlc_avcodec_fourcc spu_codecs[] =
> { VLC_CODEC_SUBT, AV_CODEC_ID_TEXT },
> { VLC_CODEC_XSUB, AV_CODEC_ID_XSUB },
> { VLC_CODEC_SSA, AV_CODEC_ID_SSA },
> +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 55, 3, 100 ) && LIBAVCODEC_VERSION_MICRO >= 100
> + { VLC_CODEC_SSA, AV_CODEC_ID_ASS },
> +#endif
The minimum supported FFmpeg libavcodec version is 57.37.100, so you
don't need check the version but whether it's FFmpeg or libav.
/* FFmpeg only */ comment is helpful in my opinion.
> /* AV_CODEC_ID_MOV_TEXT */
> { VLC_CODEC_BD_PG, AV_CODEC_ID_HDMV_PGS_SUBTITLE },
> #if LIBAVCODEC_VERSION_CHECK( 57, 999, 999, 71, 100 )
> @@ -493,7 +496,6 @@ static const struct vlc_avcodec_fourcc spu_codecs[] =
> /* ffmpeg only: AV_CODEC_ID_MPL2 */
> /* ffmpeg only: AV_CODEC_ID_VPLAYER */
> /* ffmpeg only: AV_CODEC_ID_PJS */
> - /* ffmpeg only: AV_CODEC_ID_ASS */
> };
>
> bool GetFfmpegCodec( enum es_format_category_e cat, vlc_fourcc_t i_fourcc,
More information about the vlc-devel
mailing list