summaryrefslogtreecommitdiffstats
path: root/sub
Commit message (Collapse)AuthorAgeFilesLines
* Fix potential bugs and issues, general cleanupsreimar2012-11-203-13/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* sd_ass: fix ASS subtitles coming from demux_lavfwm42012-11-161-3/+7
| | | | | libavformat demuxes ASS subtitles as complete ASS event, rather than Matroska-mangled events without time codes.
* subreader: replace sub_free() by talloc destructorwm42012-11-162-7/+7
| | | | Makes it less annoying to free the sub_data.
* clang: fix all warnings except deprecationsStefano Pigozzi2012-11-131-1/+1
|
* Rename directories, move files (step 2 of 2)wm42012-11-1214-46/+43
| | | | | | | | | | | | 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.)
* Merge branch 'osd_changes' into masterwm42012-11-0118-1447/+1282
|\ | | | | | | | | Conflicts: DOCS/man/en/options.rst
| * draw_bmp: remove swscale bug workaroundwm42012-11-011-3/+1
| | | | | | | | | | ffmpeg ticket #1852 is fixed with 425c30dda. This didn't actually happen in practice.
| * screenshot, draw_bmp: use colorspace passed with mp_imagewm42012-11-014-35/+53
| | | | | | | | | | Remove the explicit struct mp_csp_details parameters from all related functions, and use mp_image.colorspace/levels instead.
| * csputils: better support for integer color valueswm42012-10-282-2/+6
| |
| * draw_bmp, csputils: use function instead of macrowm42012-10-282-24/+7
| |
| * draw_bmp: cosmetics, refactorwm42012-10-283-434/+332
| | | | | | | | | | | | | | | | | | | | | | 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.
| * draw_bmp: remove CONDITIONAL2 codewm42012-10-241-25/+0
| | | | | | | | This was sometimes slower, sometimes slightly faster. Remove it.
| * Merge branch 'master' into osd_changeswm42012-10-241-2/+2
| |\ | | | | | | | | | | | | Conflicts: libvo/vo_xv.c
| * | options: remove --ffactor switchwm42012-10-244-11/+2
| | | | | | | | | | | | | | | | | | | | | 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.
| * | options: remove --subfont-autoscale (changes default font scale)wm42012-10-244-31/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | options: remove subtitle related options that did nothingwm42012-10-244-24/+5
| | | | | | | | | | | | | | | | | | | | | 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.
| * | draw_bmp: fix IMGFMT_BGR32 useRudolf Polzer2012-10-241-9/+15
| | |
| * | sub: add clarifying commentswm42012-10-241-1/+3
| | |
| * | draw_bmp: fix for yuy2 formatwm42012-10-241-1/+2
| | | | | | | | | | | | | | | | | | | | | 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.
| * | sub: simplify OSD redrawing logicwm42012-10-242-17/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | VO, sub: refactorwm42012-10-2412-125/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | draw_bmp: don't try to call swscale if image format not supportedwm42012-10-241-0/+3
| | | | | | | | | | | | If that happens, we silently fail.
| * | sub: add cache to mp_draw_sub_bitmaps()wm42012-10-244-19/+86
| | | | | | | | | | | | This caches scaled RGBA sub-bitmaps.
| * | sub, vf_ass: allow rendering RGBA subs, replace old vf_ass renderingwm42012-10-242-69/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | sub: fix text subtitle aspect ratio with vo_xv and vo_lavc, refactorwm42012-10-245-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | spudec: use csputils for color conversionwm42012-10-241-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | Remove things related to old OSDwm42012-10-246-1066/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | img_convert: fix alignment for RGBA imageswm42012-10-241-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | sub: add function to draw OSD into an imagewm42012-10-242-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | The osd_draw_on_image() function renders the full OSD into the provided image. It uses the mp_draw_sub_bitmaps() function added in the previous commit to do the actual work.
| * | draw_bmp: compensate for libswscale writing past image boundswm42012-10-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libswscale tends to overwrite the area between (w,y)-(0,y+1). It tries to process multiple pixels at once, and if the memory past the last x pixel is inside a SIMD operation, but still below the image stride, it overwrites that data with black. This happens with vo_x11 and 32 bit RGBA formats. The bug is visible as black bar right of the subtitle bounding box. Fix by giving libswscale more alignment. Then the "outside" pixels are inside, and are processed normally instead of overwritten with black. NOTE: we do not increase the alignment constant, because this is a separate issue from pointer alignment. libavutil's av_malloc() wouldn't actually satisfy the increased alignment either.
| * | sub: add helper to draw sub-bitmaps into an imageRudolf Polzer2012-10-242-0/+592
| | | | | | | | | | | | | | | Merged by wm4 from commits 93978f17b76d..13211ef5fc20. Changed copyright header in draw_bmp.c to "mpv", and removed the one in draw_bmp.h.
| * | Merge branch 'master' into osd_changeswm42012-10-163-18/+34
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Makefile command.c libvo/gl_common.c libvo/vo_corevideo.m libvo/vo_opengl.c libvo/vo_opengl_old.c libvo/vo_opengl_shaders.glsl sub/ass_mp.c sub/osd_libass.c sub/sd_ass.c
| * | | sub: fix and simplify some change detection detailswm42012-10-163-15/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix spudec change detection. The internal changed-flag was not reset when retrieving indexed bitmaps, and subtitles were rescaled every frame, even if they were not changing. Simplify subtitle decoders by not requiring them to check whether the passed-in screen size has changed. sd_lavc did this, and spudec would have needed to do the same. Instead, leave this to the osd_object force_redraw flag. Subtitle decoders (such as libass) can still signal that only the positions of subtitles have changed, but making _all_ subtitle decoders do this just to deal with screen size changes is worthless.
| * | | spudec.c: crop subs, set scaled flagwm42012-10-161-30/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Crop subtitle images produced by spudec.c: instead of returning a frame- sized bitmap (with possibly large transparent regions), return a cropped down rectangle of the visible part only. The old spudec scaler code had this as spudec_cut_image(), but it worked on the data converted to the old OSD format only. Move most code to setup the sub-bitmap from spudec_get_indexed() to spudec_process_data(), so that cropping can be done every time a new subtitle is decoded, instead of every frame. Set the sub_bitmaps->scaled flag. Without it, vo_gl and vo_vdpau produced ugly artifacts on the borders.
| * | | sub: switch to premultiplied alphawm42012-10-162-5/+21
| |