Commit Graph

176 Commits

Author SHA1 Message Date
Rudolf Polzer 671ca2a570 demux_mpg, ass_mp: fix warnings
The warnings in demux_mpg were silenced by additional no-operation
casts.

A variable in ass_mp was used only for some versions of libass; now the
declaration is in that version #ifdef too to avoid a compiler warning.
2012-12-28 08:40:40 +01:00
wm4 844bba6645 sub: add ASS to RGBA conversion
This makes implementing new VOs easier, because they don't have to
support the ASS format.
2012-12-28 08:30:15 +01:00
Stefano Pigozzi fab9febdc3 path: add mp_find_config_file and reorganize some of the code
Add `mp_find_config_file` to search different known paths and use that in
ass_mp to look for the fontconfig configuration file.

Some incidental changes spawned by this feature where:

 * Buffer allocation for the strings containing the paths is now performed
   with talloc. All of the allocations are done on a NULL context, but it still
   improves readability of the code.
 * Move the OSX function for lookup inside of a bundle: this code path was
   currently not used by the bundle generated with `make osxbundle`. The plan
   is to use it again in a future commit to get a fontconfig config file.
2012-12-15 17:38:00 +01:00
Stefano Pigozzi 9201cfe2bd ass_mp: allow to use a custom fontconfig configuration file
This allows to use a fontconfig fonts.conf that is customized for mpv. The
configuration file is assumed to be located at `~/.mpv/fonts.conf`. If not
found the default fcontconfig config file is used.
2012-12-15 14:16:23 +01:00
wm4 e288af5df4 sd_ass: free external subtitle tracks 2012-12-14 19:59:30 +01:00
wm4 962a97a2db sd_lavc: keep subs on subtitle track switching
Keep the currently displayed subtitles even when the user cycles through
subtitle tracks, and the subtitle is decoded by libavcodec (such as
vobsubs). Do this by not clearing the subtitles on reset(). reset() is
also called on seek, so check the start PTS whether the subtitle should
really be displayed (there's already an end PTS). Note that sd_ass does
essentially something similar.

The existing code has checks for whether the PTS reported by the demuxer
is invalid (MP_NOPTS_VALUE). I don't know under what circumstances this
can happens, so fall back to the old behavior if the PTS is invalid.
2012-12-12 22:56:41 +01:00
wm4 323eb54b60 configure: remove --disable-sortsub
Apparently this was for debugging. There was a patch to remove it years
ago, but it has been forgotten.
2012-12-11 00:37:54 +01:00
wm4 5bf8706d1f sub: remove vobsub reader in favor of ffmpeg vobsub demuxer
ffmpeg recently added a demuxer that can read vobsubs (pairs of .sub and
.idx files). Get rid of the internal vobsub reader, and use the ffmpeg
demuxer instead.

Sneak in an unrelated manpage change (autosub default).
2012-12-11 00:37:54 +01:00
wm4 01584151c8 sub: clear libavformat demuxed subtitles on seeking
libavformat demuxes ass subtitles in a broken way, that forces the
player to throw away all subtitle events received so far. See mplayer
svn commit 31293.
2012-12-03 21:08:52 +01:00
Uoti Urpala a75e65db5d subreader: fix some of ASS parser issues
The subreader.c ASS parser (used when playing an external ASS subtitle
file with --no-ass for "plaintext" display) hardcodes dialogue line
syntax instead of correctly reading it from the "Format: " line in the
file, but tried to support a varying amount of fields by guessing
where the text field (which should be last) begins. This guessing code
was buggy in many ways. Remove it and hardcode skipping 9 commas
before the text field, which should work for most files. I don't
consider the --no-ass case important enough to implement correct
parsing now. Also fix the code removing formatting tags, which failed
to remove the second in a pair of two consecutive tags.

Conflicts:
	sub/subreader.c

Merged from mplayer2 commit 91f516. Essentially reverts d5b964.
2012-12-03 21:08:52 +01:00
Uoti Urpala 72205635ab subs: remove --utf8, simplify code
Remove the options --utf8 and --unicode which had no effect any more
(what they once did should be doable with --subcp). The only use of
corresponding variables left in code was subreader.c code using
sub_utf8 as a flag indicating whether iconv conversion was active.
Change the code to test the existence of iconv context instead.

Conflicts:
	DOCS/man/en/options.rst
	core/cfg-mplayer.h
	sub/sub.c
	sub/sub.h
	sub/subreader.c

Merged from mplayer2 commit ea7311.

Note: --unicode was already removed
2012-12-03 21:08:52 +01:00
Stephen Hutchinson c082240c62 video: add support for 12 and 14 bit YUV pixel formats
Based on a patch by qyot27. Add the missing parts in mp_get_chroma_shift(),
which allow allocation of such images, and which make vo_opengl
automatically accept the new formats. Change the IMGFMT_IS_YUVP16_LE/BE
macros to properly report IMGFMT_444P14 as supported: this pixel format
has the highest numerical bit width identifier (0x55), which is not
covered by the mask ~0xfc. Remove 1 bit from the mask (makes it 0xf8) so
that IMGFMT_IS_YUVP16(IMGFMT_444P14) is 1. This is slightly risky, as
the organization of the image format IDs (actually FourCCs + mplayer
internal IDs) is messy at best, but it should be ok.
2012-12-03 21:08:51 +01:00
Stefano Pigozzi fea9ea33b2 subassconverter: correctly handle RRGGBB and unknow formats
The following HEX formats are now parsed correctly: `#RRGGBB`, `RRGGBB`.

Moreover this implementation doesn't show the HTML on screen if the input
color is not recognized. A warning is still displayed in the terminal.
2012-11-25 23:47:57 +01:00
wm4 5d5ddb2ad0 sub: add --sub-gray option to display image subs in grayscale
MPlayer/mplayer2 still show DVD subtitles in gray. Depending on who you
ask, this can be considered a bug or a feature. Include rendering in
gray as explicit feature, so the user can decide what is better.

This affects all indexed sub bitmaps entering the OSD rendering path.
Currently, this means all image subs are affected by this option, but
nothing else.
2012-11-25 23:40:07 +01:00
wm4 24bfa82a91 sub: reimplement -spugauss as --sub-gauss
Apparently the -spugauss option was popular. The code originally
implementing this is gone (scaler stuff in spudec.c). Reimplement it
using libswscale to scale and blur image subtitles if the --sub-gauss
option is set.

The code does some rather lazy padding to allow the blur to spread
pixels past the original image bounding box. (This problem exists with
normal bilinear scaling too, but is barely noticable.)

Technically, this doesn't just blur subtitles, but anything RGBA (or
indexed) that enters the OSD rendering path. But only image subtitles
produce these OSD formats currently, so no explicit check is done to
prevent blurring in other cases.
2012-11-25 23:40:07 +01:00
wm4 11783b5ede osd: fix z-order of subtitle OSD elements
Subs should always be below OSD (meaning they have to be drawn first).
2012-11-22 15:27:02 +01:00
wm4 86ad77d0db draw_bmp: add RGB rendering to fix image quality issues
As pointed out in commit ed01df, the quality loss due to frequent
conversion between RGB and YUV is too much when drawing OSD and
subtitles.

Fix this by staying in the same colorspace when drawing subtitles.
Render directly to RGB, without converting to YUV first.

The bad thing about packed RGB is that there are many pixel formats,
which would all require special code for blending. It's also completely
incompatible to planar YUV. Use planar RGB instead, which allows us to
reuse all code originally written for planar YUV. The only thing that
needs to be changed is the color conversion in the libass case. (In
exchange for simpler code, the image has to be copied, but this is
still much better than converting to YUV.)

Unfortunately, libswscale doesn't support planar RGB output. Add a hack
to sws_utils.c to handle conversion to planar RGB. In the common case,
when converting 32 bit per pixel RGB, calling swscale can be avoided
entirely.

The change in mp_image.c is needed to allocate GBRP images correctly.

(The issue with vo_x11 could be easily solved by always backing up the
same bounding box as the bitmap drawing RGB<->YUV conversion does, but
this commit is probably the better fix.)
2012-11-22 15:26:38 +01:00
cigaes 73618d11d4 subreader: do not skip the first char of ASS fields.
Without this change, fields that can be sometimes empty and
sometimes not, such as the Effect field, are counted in an
inconsistent way. Since the number of fields is used to find
where the text starts, it leads to internal field arriving
on the video.

Bug reported anonymously on the users mailing list.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35426 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-11-21 20:00:52 +01:00
wm4 ea4332daf4 vo_xv: don't require frame stepping to remove OSD or subs
In order to improve performance, vo_xv didn't create a backup of the
video frame before drawing OSD and subtitles during normal playback. It
required the frontend to do frame stepping if it wanted to redraw the
OSD, but no backup of the video frame was available. (Consider the
following use case: enable the OSD permanently with --osd-level=3, then
pause during playback and do something that shows an OSD message. The
player will advance the video by one frame at the time the new OSD
message is first drawn.)

This also meant that taking a screenshot during playback with vo_xv
would include OSD and subtitles in the resulting image.

Fix this by always creating a backup before drawing OSD or subtitles.
In order to avoid having to create a full copy of the whole image frame,
introduce a complex scheme that tries to backup only the changed
regions.

It's unclear whether the additional complexity in draw_bmp.c for
backing up only the changed areas of the frame is worth it. Possibly
a simpler implementation would suffice, such as tracking only Y ranges
of changed image data, or even just copying the full frame.

vo_xv's get_screenshot() now always creates a copy in order not to
modify the currently displayed frame.
2012-11-21 19:56:59 +01:00
wm4 80270218cb osd: make the OSD and sub font more customizable
Make more aspects of the OSD font customizable. This also affects the
font used for unstyled subtitles (such as SRT), or when using the
--no-ass option. This adds back some customizability that was lost with
commit 74e7a1 (osd: use libass for OSD rendering).

Removed options:
--ass-border-color
--ass-color
--font
--subfont
--subfont-text-scale

Added options:
--osd-color
--osd-border
--osd-back-color
--osd-shadow-color
--osd-font
--osd-font-size
--osd-border-size
--osd-margin-x
--osd-margin-y
--osd-shadow-offset
--osd-spacing
--sub-scale

The font size is now specified in pixels as it would be rendered on a
window with a height of 720 pixels. OSD and subtitles are always scaled
with the window height, so specifying or expecting an absolute font
size doesn't make sense.

Such scaled pixel units are used to specify font border etc. as well.

(Note: the font size is directly passed to libass. How the fonts are
actually rasterized is outside of our control, but in theory ASS font
sizes map to "script" pixels and then are scaled to screen size.)

The default settings should be about the same, with slight difference
due to rounding to the new scales.

The OSD and subtitle fonts are not separately configurable. It has
limited use and would double the number of newly added options, which
would be more confusing than helpful. It could be easily added later,
should the need arise.

Other small details that change:
- ASS_Style.Encoding is not set to -1 for subs anymore
  (assuming subs use VSFilter direction in -no-ass mode too)
- use a different WrapStyle for OSD
- ASS forced styles are not applied to OSD
2012-11-20 18:00:15 +01:00
reimar 3f85094d4e Fix potential bugs and issues, general cleanups
Most of these are reimar fixing issues found by Coverity static
analyzer, and possibly some more cleanup commits independent from
this.

Since these commits are rather noisy, squash them all together.

Try to make code a bit clearer.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35294 b3059339-0415-0410-9bf9-f77b7e298cf2

Conflicts:
	audio/out/ao_alsa.c

Check the correct variable for NULL.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35323 b3059339-0415-0410-9bf9-f77b7e298cf2

Remove pointless unreachable code (the loop condition already checks
the 0xff case).

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35325 b3059339-0415-0410-9bf9-f77b7e298cf2

Fix typo that might have caused reading beyond the string end.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35326 b3059339-0415-0410-9bf9-f77b7e298cf2

Do not needlessly use "long" types.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35331 b3059339-0415-0410-9bf9-f77b7e298cf2

Use AV_RB32 to avoid sign extension issues and validate offset before using it.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35332 b3059339-0415-0410-9bf9-f77b7e298cf2

Remove nonsense casts.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35343 b3059339-0415-0410-9bf9-f77b7e298cf2

Fix crash in case sh_audio allocation failed.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35348 b3059339-0415-0410-9bf9-f77b7e298cf2

Fix potential NULL dereference.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35351 b3059339-0415-0410-9bf9-f77b7e298cf2

Conflicts:
	libmpcodecs/ad_ffmpeg.c

Note: Slightly modified.

Fix malloc failure check to check the correct variable.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35353 b3059339-0415-0410-9bf9-f77b7e298cf2

Avoid code duplication and pointless casts.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35363 b3059339-0415-0410-9bf9-f77b7e298cf2

Conflicts:
	stream/tv.c

Error out if an invalid channel list name was specified
instead of continuing and reading outside array bounds
all over the place.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35364 b3059339-0415-0410-9bf9-f77b7e298cf2

Conflicts:
	stream/tv.c

Make array "static const".

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35365 b3059339-0415-0410-9bf9-f77b7e298cf2

Properly free resources even when encountering many
parse errors.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35367 b3059339-0415-0410-9bf9-f77b7e298cf2

Conflicts:
	parser-cfg.c

Avoid leaks in error handling.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35380 b3059339-0415-0410-9bf9-f77b7e298cf2

Do not do sign comparisons on "char" type which can be both signed or unsigned.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35381 b3059339-0415-0410-9bf9-f77b7e298cf2

Free cookies file data after parsing it.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35382 b3059339-0415-0410-9bf9-f77b7e298cf2

http_set_field only makes a copy of the string, so we still need to
free it.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35383 b3059339-0415-0410-9bf9-f77b7e298cf2

check4proxies does not modify input URL, so mark it const.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35390 b3059339-0415-0410-9bf9-f77b7e298cf2

Remove proxy "support" from stream_rtp and stream_upd, trying
to use a http proxy for UDP connections makes no sense.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35394 b3059339-0415-0410-9bf9-f77b7e298cf2

Conflicts:
	stream/stream_rtp.c
	stream/stream_udp.c

Add url_new_with_proxy function to reduce code duplication and memleaks.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35395 b3059339-0415-0410-9bf9-f77b7e298cf2

Conflicts:
	stream/pnm.c
	stream/stream_live555.c
	stream/stream_nemesi.c
	stream/stream_rtsp.c

Fix off-by-one errors in file descriptor validity checks.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35402 b3059339-0415-0410-9bf9-f77b7e298cf2

Remove pointless cast.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35403 b3059339-0415-0410-9bf9-f77b7e298cf2

Abort when opening the file failed instead of calling
"write" with an invalid descriptor.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35404 b3059339-0415-0410-9bf9-f77b7e298cf2

Remove pointless local variable.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35411 b3059339-0415-0410-9bf9-f77b7e298cf2

Conflicts:
	stream/http.c
2012-11-20 18:00:14 +01:00
wm4 af8ded53db sd_ass: fix ASS subtitles coming from demux_lavf
libavformat demuxes ASS subtitles as complete ASS event, rather than
Matroska-mangled events without time codes.
2012-11-16 22:54:22 +01:00
wm4 dd7dc2ee3d subreader: replace sub_free() by talloc destructor
Makes it less annoying to free the sub_data.
2012-11-16 21:21:15 +01:00
Stefano Pigozzi bec630c347 clang: fix all warnings except deprecations 2012-11-13 22:19:18 +01:00
wm4 4873b32c59 Rename directories, move files (step 2 of 2)
Finish renaming directories and moving files. Adjust all include
statements to make the previous commit compile.

The two commits are separate, because git is bad at tracking renames
and content changes at the same time.

Also take this as an opportunity to remove the separation between
"common" and "mplayer" sources in the Makefile. ("common" used to be
shared between mplayer and mencoder.)
2012-11-12 20:08:18 +01:00
wm4 84829a4ea1 Merge branch 'osd_changes' into master
Conflicts:
	DOCS/man/en/options.rst
2012-11-01 02:12:47 +01:00
wm4 f4069259cf draw_bmp: remove swscale bug workaround
ffmpeg ticket #1852 is fixed with 425c30dda. This didn't actually happen
in practice.
2012-11-01 02:07:46 +01:00
wm4 9ba52ea6ef screenshot, draw_bmp: use colorspace passed with mp_image
Remove the explicit struct mp_csp_details parameters from all related
functions, and use mp_image.colorspace/levels instead.
2012-11-01 02:07:45 +01:00
reimar 6c141b60b5 subreader: do not write outside array bounds
Extra checks to ensure we really do not write outside
array bounds.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35313 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-31 22:45:38 +01:00
reimar 78899a096f spudec: set pointers to NULL after free
Set pointers to NULL after free.
For the pal_image one it would have been possible
to leak the old pointer of the malloc for "image" failed.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35303 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-31 22:43:26 +01:00
wm4 d072e857d7 csputils: better support for integer color values 2012-10-28 15:31:32 +01:00
wm4 65b313a8b0 draw_bmp, csputils: use function instead of macro 2012-10-28 15:31:32 +01:00
wm4 18d4eebedb draw_bmp: cosmetics, refactor
Mostly pedantic bikeshedding issues.

Move some code around, so that the sub_bitmap_to_mp_images() function
can be split into two parts. This is better than having a big function
with many input and outputs, of which only half are used in each code
path.

Also, try to make code simpler by using a mp_rect type.
2012-10-28 15:31:31 +01:00
wm4 f50d0b16e0 draw_bmp: remove CONDITIONAL2 code
This was sometimes slower, sometimes slightly faster. Remove it.
2012-10-24 23:12:26 +02:00
wm4 0e81d62c53 Merge branch 'master' into osd_changes
Conflicts:
	libvo/vo_xv.c
2012-10-24 22:38:45 +02:00
wm4 3d98e8c674 options: remove --ffactor switch
This controlled the generation of the palette for DVD subs if no palette
was found. The option name and description is confusing, and it was
probably barely useful. Remove the option, and hardcode the behavior to
the option's default value.
2012-10-24 21:56:35 +02:00
wm4 a8824f12dd options: remove --subfont-autoscale (changes default font scale)
The code for this option attempted to emulate the old as-documented
behavior. It wasn't very good at it, and now that the old OSD code has
been removed, it's entirely pointless.

This removes the factor 1.7 with which --subfont-text-scale was
multiplied.
2012-10-24 21:56:35 +02:00
wm4 2afd7ebb4e options: remove subtitle related options that did nothing
Most of these cased working when the OSD was switched to libass, or
didn't do anything even before that.

Also don't recursively include subreader.h in sub.h.
2012-10-24 21:56:35 +02:00
Rudolf Polzer e1e056fe5d draw_bmp: fix IMGFMT_BGR32 use 2012-10-24 21:56:35 +02:00
wm4 77016efd27 sub: add clarifying comments 2012-10-24 21:56:35 +02:00
wm4 4b4e4b5690 draw_bmp: fix for yuy2 format
mp_get_chroma_shift() modifies its argument even if it fails, so we have
to restore that.

mp_image didn't set chroma shifts for yuy2.
2012-10-24 21:56:34 +02:00
wm4 0c49ddc818 sub: simplify OSD redrawing logic
Normally, we can redraw the OSD any time. But some drivers don't support
OSD redrawing (vo_null etc.), or only "sometimes" (vo_xv). For that,
some additional logic is needed. Simplify that logic. This might also
fix subtle bugs with the OSD not updating or endless frame stepping in
unforseen corner cases.

Do this by adding a new flag, which tells whether the OSD should be
redrawn.

Remove some minor code duplication.
2012-10-24 21:56:34 +02:00
wm4 4d11f32162 VO, sub: refactor
Remove VFCTRL_DRAW_OSD, VFCAP_EOSD_FILTER, VFCAP_EOSD_RGBA, VFCAP_EOSD,
VOCTRL_DRAW_EOSD, VOCTRL_GET_EOSD_RES, VOCTRL_QUERY_EOSD_FORMAT.

Remove draw_osd_with_eosd(), which rendered the OSD by calling
VOCTRL_DRAW_EOSD. Change VOs to call osd_draw() directly, which takes
a callback as argument. (This basically works like the old OSD API,
except multiple OSD bitmap formats are supported and caching is
possible.)

Remove all mentions of "eosd". It's simply "osd" now.

Make OSD size per-OSD-object, as they can be different when using
vf_sub. Include display_par/video_par in resolution change detection.

Fix the issue with margin borders in vo_corevideo.
2012-10-24 21:56:34 +02:00
wm4 a4f9077f6c draw_bmp: don't try to call swscale if image format not supported
If that happens, we silently fail.
2012-10-24 21:56:34 +02:00
wm4 bf68634d15 sub: add cache to mp_draw_sub_bitmaps()
This caches scaled RGBA sub-bitmaps.
2012-10-24 21:56:34 +02:00
wm4 97c6425140 sub, vf_ass: allow rendering RGBA subs, replace old vf_ass rendering
Do this by replacing all the old vf_ass drawing code by draw_bmp.c.

Change sub.c to always use osd_draw() for the other OSD drawing
routines, and simplify the code a bit.

spudec.c subtitles (i.e. DVD subs) are now considered subtitles, and
are rendered by vf_ass, if that filter is inserted.
2012-10-24 21:56:33 +02:00
wm4 98f74335d5 sub: fix text subtitle aspect ratio with vo_xv and vo_lavc, refactor
This fixes that vo_xv didn't display text subtitles correctly when
using anamorphic video. It didn't pass the aspect information to the
subtitle renderer. Also, try to render OSD correctly with respect to
aspect ratio settings: on vo_xv, the OSD is rendered into the video,
and needs to be "stretched" too when playing anamorphic video. When
the -monitorpixelaspect option is used, even with VOs such as vo_opengl
the OSD has to be rendered with that aspect ratio.

As preparation for future commits, replace the weird vsfilter_scale
value with a somewhat more sensible video_par member.

Also, struct mp_eosd_res is a better place for the aspect ratio
parameters, as OSD needs this too.

Use osd_draw_on_image() directly in vo_lavc, which fixes aspect ratio
issues as well.
2012-10-24 21:56:33 +02:00
wm4 f6197249a7 spudec: use csputils for color conversion
Just to get rid of that conversion copy&pasted from the internet.

R and G are swapped for unknown reasons. Testing various subtitles
seem to yield the same results as VLC. The sub-bitmap renderers output
the correct colors. The colorspace conversion is used without problems
for vo_gl, vo_gl3 and vo_vdpau. The problem is most likely that
apparently, the DVD palette read from the subtitle track extradata is
converted to YUV using vobsub_palette_to_yuv(), and swapped in the
process. Or in other words, the YUV colors spu->global_palette are
encoded with R and G swapped.

Add some utility definition to csputils.c/h to make converting single
color values easier.
2012-10-24 21:56:33 +02:00
wm4 fd5c4a1984 Remove things related to old OSD
To ease changing all the VOs to the new OSD rendering, fallbacks,
conversions, support code etc. was left all over the code. Now that
all VOs have been changed, all that code is inactive. Remove it.

Strip down spudec.c. We don't need the old grayscale and scaling stuff
anymore. (Not removing spudec itself yet - I'm not confident that the
libavcodec DVD sub decoder is sufficient, and it would also require
some hacks to get DVD palette and resolution information from libdvdread
to libavcodec.)

The option --spuaa, --spualign, --spugauss were used with the old sub
scaling code, and don't do anything anymore.
2012-10-24 21:56:33 +02:00
wm4 7b203b5e05 img_convert: fix alignment for RGBA images
draw_bmp.c uses libswscale, which has strict alignment requirements on
input images. Since imp_convert.c is currently the only producer of RGBA
sub-bitmaps, the overall code becomes easier if the alignment is done on
image allocation, rather than forcing draw_bmp.c to create an aligned
copy.

talloc doesn't align to 16 bytes, as required by libswscale. Apparently,
system malloc (glibc/Linux/32 bit) aligns to 8 bytes only, so talloc's
own code to align to 16 bytes is ineffective. Work around by using
mp_image to allocate the image.
2012-10-24 21:56:33 +02:00