[FFmpeg-devel] [PATCH] lavf/matroska: Handle ASS as ASS instead of SSA

wm4 nfxjfg at googlemail.com
Thu May 1 11:27:52 CEST 2014


On Wed, 30 Apr 2014 23:24:52 +0200
Clément Bœsch <u at pkh.me> wrote:

> On Thu, May 01, 2014 at 01:18:32AM +0400, ValdikSS wrote:
> > On 05/01/2014 01:05 AM, Clément Bœsch wrote:
> > >On Thu, May 01, 2014 at 12:56:23AM +0400, ValdikSS wrote:
> > >>After introducing ASS codec id and renaming (old) ASS to SSA,
> > >>Matroska ASS codec tag was mistakenly renamed too, making ASS
> > >>subtitles handled as SSA.
> > >>
> > >>This fixes Ticket #3491
> > >>---
> > >>  libavformat/matroska.c | 4 ++--
> > >>  1 file changed, 2 insertions(+), 2 deletions(-)
> > >>
> > >>diff --git a/libavformat/matroska.c b/libavformat/matroska.c
> > >>index e8e9996..7dc09b3 100644
> > >>--- a/libavformat/matroska.c
> > >>+++ b/libavformat/matroska.c
> > >>@@ -67,9 +67,9 @@ const CodecTags ff_mkv_codec_tags[]={
> > >>      {"S_TEXT/UTF8"      , AV_CODEC_ID_SRT},
> > >>      {"S_TEXT/ASCII"     , AV_CODEC_ID_TEXT},
> > >>  #if FF_API_ASS_SSA
> > >>-    {"S_TEXT/ASS"       , AV_CODEC_ID_SSA},
> > >>+    {"S_TEXT/ASS"       , AV_CODEC_ID_ASS},
> > >>      {"S_TEXT/SSA"       , AV_CODEC_ID_SSA},
> > >>-    {"S_ASS"            , AV_CODEC_ID_SSA},
> > >>+    {"S_ASS"            , AV_CODEC_ID_ASS},
> > >>      {"S_SSA"            , AV_CODEC_ID_SSA},
> > >>  #endif
> > >>      {"S_TEXT/ASS"       , AV_CODEC_ID_ASS},
> > >
> > >This was for compatibility, look below the #if/#endif. "SSA" packets were
> > >still preferred, but maybe we can remove that ifdefery now.
> > >
> > >(Note that I didn't look at the ticket yet)
> > As far as I understand, this #if/#endif block is used only if we use new
> > API, which was introduced with the ASS/SSA split. If FF_API_ASS_SSA is not
> > defined, we use old api with old ASS (and without SSA).
> > 
> > If the old API is not used anymore, it might be better to always use
> > #if/#endif block and remove the block below.
> 
> See 7c1a002c
> 
> tl;dr: AV_CODEC_ID_SSA is the old re-crafted hack format, AV_CODEC_ID_ASS
> is the new verbatim data from mkv. Until the next bump (FF_API_ASS_SSA
> ifdefery), we still continue to re-craft the packets because the
> applications might be relying on that format instead. When we will bump,
> the FF_API_ASS_SSA chunk will disappear and the verbatim format will be
> choosen.
> 

And to stress this, AV_CODEC_ID_SSA has NOTHING to do with SSA.
AV_CODEC_ID_SSA is the old _internal_ format that was used with _both_
SSA and ASS, and AV_CODEC_ID_ASS is the new internal format used with
_both_ SSA and ASS.

The new name was picked because AV_CODEC_ID_SSA had to be deprecated
(as it's incompatible), and calling it ASS is more modern, so
AV_CODEC_ID_ASS seemed like an obvious choice.


More information about the ffmpeg-devel mailing list