[MPlayer-dev-eng] [PATCH] Support for DVB subtitles

Uoti Urpala uoti.urpala at pp1.inet.fi
Sat Feb 28 04:51:30 CET 2009


On Sat, 2009-02-28 at 00:41 +0100, Nicolas George wrote:
> The attached patch adds support for DVB subtitles. The color is currently
> downgraded to a single alpha channel; there is room for enhancement here.

I didn't read it in detail but it seems sane. The subtitle code overall
should be factored more like audio and video decoders instead of
everything directly calling functions specific to one subtitle type, but
fixing all the existing subtitle code is a separate task...

Two issues I noticed with a quick look:
(Makefile)
               cpudetect.c \
+	      dvbsub.c \

The added line has a tab, should be spaces.

(dvdsub.c)
+static AVCodecContext *decoder = NULL;
+dvbsub_frame_t *dvbsub_frames = NULL;
+static ass_image_t *images = NULL;
+static int rendered = 0;
+static int frame_w = 360;
+static int frame_h = 576;

This stuff should be in a context struct to allow multiple decoder
instances. Even if the address of that struct is kept in a global/static
for now (I don't remember whether there already is some suitable place
to keep it - at least in svn there probably isn't).

> If anyone thinks that the way I plugged it directly in vf_ass, my answer is
> that I totally agree and I would like some help to have my previous patch
> accepted.

I think a better way to clean things up is to move the subtitle type
specific code into common subtitle handling. So vf_ass (now a misleading
name) would call a subtitle function to get the images for a particular
pts, and that function would use either libass or dvbsub to generate
them as appropriate.




More information about the MPlayer-dev-eng mailing list