[vlc-devel] [PATCH] Map AV_CODEC_ID_ASS to VLC_CODEC_SSA

Zhao Zhili quinkblack at foxmail.com
Wed Dec 26 13:46:57 CET 2018


On 2018/12/26 下午8:23, Zhao Zhili wrote:
> On 2018/12/26 下午7:31, 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..a20340a 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_CHECK( 55, 999, 999, 3, 100 )
>> +    { VLC_CODEC_SSA, AV_CODEC_ID_ASS },
>> +#endif
> I think it doesn't work.
> AV_VERSION_INT is defined as
> #define AV_VERSION_INT(a, b, c) ((a)<<16 | (b)<<8 | (c))
>
> AV_VERSION_INT(55, 999, 999) = 3663847
> AV_VERSION_INT(58, 9, 0) = 3803392
>
> libavcodec 58.9.0 doesn't have AV_CODEC_ID_ASS
>
> 999 is not large enough.

Actually, for 'b' and 'c' in the macro, they are supposed to not larger 
than 255.
Set 'b' to  (1 << 16) should work until a > 255. It's still a bit ugly.

>
>>       /* 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,
>
>
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel





More information about the vlc-devel mailing list