summaryrefslogtreecommitdiffstats
path: root/core
Commit message (Collapse)AuthorAgeFilesLines
* Remove BSD legacy TV/radio support (BT848 stuff)wm42013-02-061-4/+0
| | | | | FreeBSD actually supports V4L2, and V4L2 supports this chip. Also, this chip is from 1997. Farewell.
* core: remove --edlout functionalitywm42013-02-066-41/+0
| | | | | | | | | | | | | | | | This could write .edl files in MPlayer's format. Support for playing these files has been removed from mplayer2 quite a while ago. (mplayer2 can play its own, "new" .edl format, but does not support writing it.) Since this is a rather obscure functionality, and it's not really clear how it should behave (e.g. what should it do if a new file is played), and wasn't all that great to begin with (what if you made a mistake? the "edl_mark" command sucks for editing), get rid of it. Suggestions how to reimplement this in a nicer way are welcome. If it's just about retrieving timecodes, this in input.conf will do: KEY print_text "position: ${=time-pos}"
* command: add command to show playlist on OSDwm42013-02-063-0/+22
|
* mplayer: don't show bogus audio PTS during hr-seekwm42013-02-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a problem that happened with syncplay.pl [1] when ad_mpg123 was in use, and get_current_time() returning a bogus time position. This only happens during seeking; the reported time is correct after the seek is done. The audio PTS as returned by playing_audio_pts() is simply bogus during hr-seek. With ad_ffmpeg, it was actually set to MP_NOPTS_VALUE during seeking, so get_current_time() did a fallback to the video PTS. However, ad_mpg123 is different and explicitly decodes some audio when resetting on seek (reasons why it does this unknown and uninvestigated; apparently it's to reinit libmpg123). As a result, the audio PTS was set to the start position of the seek (or something similar), which could be very different from the seek target time. This confused syncplay. It got the bogus time because it spams the player with read commands to the "time-pos" property, so this corner case was hit. Fix this by making get_current_time() return the seek target time if hr-seek is active. This should make behavior the same as before commit 3f949cf "mplayer: prefer audio PTS over video PTS for status line". [1] http://syncplay.pl
* mplayer: properly handle framestep when showing last video framewm42013-02-031-10/+12
| | | | | | | | | | | | | | When doing a framestep while there is no more video, nothing happened, and audio continued to play. When advancing to the next file, the player was paused. Fix it so that it always pauses (except on very low frame rate video, which is yet another corner case). We also change the meaning of framestepping a bit: in audio only mode, framstepping unpauses for a single playloop iteration. This is probably not useful at all, but makes the code a bit more simpler/uniform. Just like the previous commit, this matters most for audio files with cover art, for which this special case is the normal case.
* mplayer: reset audio/video delay if there's no next video framewm42013-02-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | mpctx->delay is used to control audio/video sync. If more audio than video has been played, it grows larger, meaning A/V desync is happening. This logic is a bit broken when video has ended, and audio is still playing. In that case, it tries to read additional video frames from the video decoder (because even if you don't feed new packets to the decoder, it could still return delayed frames). For that, the code to determine whether frames should be dropped is invoked (check_framedrop()). This function detects that video is behind audio (mpctx- >delay growing big), and attempts to issue a framedrop. Reset mpctx->delay if there's no more video. This fixes the the frame drop display "counting up" on each playloop iteration when playing audio files with cover art. These files are basically audio+video files with a single video frame. When playing these files the the corner case of having run out of video while audio is still playing is the normal case. Also reset mpctx->last_av_difference. This is not updated anymore if video ends (since update_avsync() sets it, but it's not called if video_left is false). This removes the "stuck" A/V sync value when video ends. With audio files containing cover art we would display a meaningless value over the duration of the whole file otherwise.
* input: free all queued/allocated commands on exitwm42013-02-031-4/+21
| | | | | | | | | These were memory leaks in theory, though not in practice (all memory is free'd on exit anyway). However, it was still annoying when leak reporting is enabled. I'm not sure if there was an actual leak in check_autorepeat(), maybe not.
* mplayer: make advancing the playlist respect loopingwm42013-02-033-10/+23
| | | | | | | | | | | | | | | Explicitly advancing the playlist with input commands ("playlist_next") didn't jump back to the first file, if the current file was the last on the playlist and looping was enabled. Fix this and make the behavior with explicit input and playback EOF the same. Also add a minor feature: if looping is enabled, and the current file is the first on the playlist, going back one entry jumps to the last playlist entry (without changing loop count). Fixes #22.
* demux_lavf: remove weird stream auto-selectionwm42013-02-031-11/+0
| | | | | | | Should be dead code. Stream selection is handled either during demuxer initialization, or via DEMUXER_CTRL_SWITCH_*. (If there were actually situations where this code did something, it was probably broken anyway.)
* mp_common: improve OSD/status time formattingwm42013-02-031-4/+11
| | | | | | | | | Allow negative times. Timestamps can be negative, and we actually display negative time for other reasons too, such as when waiting for the old audio to drain with gapless audio.) Avoid overflows with relatively large time values. (We still don't handle values too large for int64_t.)
* cocoa_events: remove this functionalityStefano Pigozzi2013-02-021-16/+0
| | | | | | | | | | | | | This functionality looked smart but created problems with some kinds of multi touch events. Moreover some events coming from the windows server – like hovering a corner for window resize – didn't cause the player to wake up immediately. The "correct" non hacky way to implement async event polling with cocoa would be having the vanilla cocoa event loop driving the player and setting up mpv's terminal FDs as event sources for the cocoa event loop. Fixes #20
* screenshot: minor simplification, prefer VF over VOwm42013-01-301-22/+5
| | | | | | | | | | | | | Remove screenshot_force and associated logic. Always try to use the screenshot video filter before trying taking screenshots with the VO, which means that --vf=screenshot now takes the role of --vf=screenshot_force. (To make this clear, not adding a video filter is still the recommended way to take screenshots; we just change how VF screenshots are forced.) Preferring VO over VF and having --vf=screenshot_force used to make sense when not all VOs supported screenshots, and some VOs had somewhat broken screenshots (like vo_xv taking screenshots with OSD in it). But all these issues are fixed now, so just get rid of the cruft.
* mplayer: add newline for --print-msgwm42013-01-301-1/+1
|
* x11: cleanup, refactorwm42013-01-274-7/+7
| | | | | | | | | | | | | | | | Move things that are used by vo_xv only into vo_xv, same for vo_x11. Rename some functions exported by x11_common, like vo_init to vo_x11_common. Make functions not used outsode of x11_common.c private to that file. Eliminate all global variables defined by x11_common (except error handler and colormap stuff). There shouldn't be any functional changes, and only code is moved around. There are some minor simplifications in the X11 init code, as we completely remove the ability to initialize X11 and X11+VO separately (see commit b4d9647 "mplayer: do not create X11 state in player frontend"), and the respective functions are conflated into vo_x11_init() and vo_x11_uninit().
* stream: implement some HTTP specific options for stream_lavfwm42013-01-241-13/+0
| | | | | | | | | | | | | | | | | | The "http:" protocol has been switched to use ffmpeg's HTTP implementation some time ago. One problem with this was that many HTTP specific options stopped working, because they were obviously implemented for the internal HTTP implementation only. Add the missing things. Note that many options will work for ffmpeg only, as Libav's HTTP implementation is missing these. They will silently be ignored on Libav. Some options we can't fix: --ipv4-only-proxy, --prefer-ipv4, --prefer-ipv6 As far as I can see, not even libavformat internals distinguish between ipv4 and ipv6. --user, --passwd ffmpeg probably supports specifying these in the URL directly.
* sub: add stupid hack for vobsub decoding with Libavwm42013-01-241-1/+10
| | | | | | | If we detect Libav, always use the old builtin vobsub decoder (in spudec.c). Note that we do not want to use it for newer ffmpeg, as spudec.c can't handle the vobsub packets as generated by the .idx demuxer, and we want to get rid of spudec.c in general anyway.
* mp_msg, getch2: unix tty background supportRudolf Polzer2013-01-232-0/+20
| | | | | | | | Now, when backgrounded, mpv plays and outputs messages to stdout, but statusline is not output. Background<->foreground transitions are detected by signals and polling the process groups.
* options: make --fullscreen not a global optionwm42013-01-231-2/+2
| | | | | | | This was disabled in 4ea60a3 and 70c455a, when all options were still forced file local, and resetting fullscreen was annoyingly reset when switching to the next file. mpv keeps all options by default, so this isn't needed anymore.
* video: remove -x/-y/-xy optionswm42013-01-232-7/+0
| | | | | | | | | | | | | | | -x/-y were rather useless and obscure. The only use I can see is forcing a specific aspect ratio without having to calculate the aspect ratio float value (although --aspect takes values of the form w:h). This can be also done with --geometry and --no-keepaspect. There was also a comment that -x/-y is useful for -vm, although I don't see how this is useful as it still messes up aspect ratio. -xy is mostly obsolete. It does two things: a) set the window width to a pixel value, b) scale the window size by a factor. a) is already done by --autofit (--autofit=num does exactly the same thing as --xy=num, if num >= 8). b) is not all that useful, so we just drop that functionality.
* video: add --autofit and --autofit-larger optionswm42013-01-234-0/+34
| | | | | | | | | --autofit=WxH sets the window size to a maximum width and/or height, without changing the window's aspect ratio. --autofit-larger=WxH does the same, but only if the video size is actually larger than the window size that would result when using the --autofit=WxH option with the same arguments.
* options: allow using % for width and height in --geometrywm42013-01-232-63/+83
| | | | | | | | | | | | | | | | | | | | Now all numbers in the --geometry specification can take percentages. Rewrite the parsing of --geometry, because adjusting the sscanf() mess would require adding all the combinations of using and not using %. As a side effect, using % and pixel values can be freely mixed. Keep the aspect if only one of width or height is set. This is more useful in general. Note: there is one semantic change: --geometry=num used to mean setting the window X position, but now it means setting the window width. Apparently this was a mplayer-specific feature (not part of standard X geometry specifications), and it doesn't look like an overly useful feature, so we are fine with breaking it. In general, the new parsing should still adhere to standard X geometry specification (as used by XParseGeometry()).
* options: move -geometry parsing to m_option.cwm42013-01-234-3/+142
| | | | | | | | | This also means the option is verified on program start, not when the VO is created. The actual code becomes a bit more complex, because the screen width/height is not available at program start. The actual parsing code is still the same, with its unusual sscanf() usage.
* video: reset filters on seekwm42013-01-201-0/+2
| | | | | | | | | | | | | | | | Drop queued frames on seek. Reset the internal state of some filters that seem to need it as well: at least vf_divtc still produced some frames using the previous PTS. This fixes weird behavior with some filters on seeking. In particular, this could lead to A/V desync or apparent lockups due to the PTS of filtered frames being too far away from audio PTS. This commit does only the minimally required work to fix these PTS related issues. Some filters have state dependent on previously filtered frames, and these are not automatically reset with this commit (even vf_divtc and vf_softpulldown reset the PTS info only). Filters that actually require a full reset can implement VFCTRL_SEEK_RESET.
* core: make gapless-audio also apply to format changes within a fileRudolf Polzer2013-01-181-1/+2
| | | | | | Format changes within a file can e.g. happen in MPEG-TS streams. This fix also fixes encoding of such files, because ao_lavc is not capable of reconfiguring the audio stream.
* input: enqueue commands to the end of the queueStefano Pigozzi2013-01-161-1/+1
| | | | | `mp_input_queue_cmd` erroneusly added commands to the head of the queue resulting in LIFO behaviour instead of the intended FIFO.
* vd_lavc: remove -lavdopts vstats suboptionwm42013-01-131-1/+0
| | | | | | This printed per-frame statistics into a file, like bitrate or frame type. Not very useful and accesses obscure AVCodecContext fields (danger of deprecation/breakage), so get rid of it.
* vd_lavc: remove lowres decodingwm42013-01-131-1/+0
| | | | | | | | | | This was a "broken misfeature" according to Libav developers. It wasn't implemented for modern codecs (like h264), and has been removed from Libav a while ago (the AVCodecContext field has been marked as deprecated and its value is ignored). FFmpeg still supports it, but isn't much useful due to aforementioned reasons. Remove the code to enable it.
* sub: add experimental --force-rgba-osd-rendering switchwm42013-01-132-0/+2
|
* mp_common: add some rectangle utility functionswm42013-01-132-0/+26
|
* sub: do not copy the target image if there is no OSD/subswm42013-01-131-2/+0
| | | | | | | | | | | | | | | | | | | | | It's not easy to tell whether the OSD/subs are empty, or if something is drawn. In general you have to use osd_draw() with a custom callback. If nothing is visible, the callback is never invoked. (The actual reason why this is so "hard" is the implementation of osd_libass.c, which doesn't allow separating rendering and drawing of OSD elements, because all OSD elements share the same ASS_Renderer.) To simplify avoiding copies, make osd_draw_on_image() instead of the caller use mp_image_make_writeable(). Introduce osd_draw_on_image_p(), which works like osd_draw_on_image(), but gets the new image allocation from an image pool. This is supposed to be an optimization, because it reduces the frequency of large allocations/deallocations for image data. The result of this is that the frequency of copies needed in conjunction with vf_sub, screenshots, and vo_lavc (encoding) should be reduced. vf_sub now always does true pass-through if no subs are shown. Drop the pts check from vf_sub. This didn't make much sense.
* video: decouple internal pixel formats from FourCCswm42013-01-134-1/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mplayer's video chain traditionally used FourCCs for pixel formats. For example, it used IMGFMT_YV12 for 4:2:0 YUV, which was defined to the string 'YV12' interpreted as unsigned int. Additionally, it used to encode information into the numeric values of some formats. The RGB formats had their bit depth and endian encoded into the least significant byte. Extended planar formats (420P10 etc.) had chroma shift, endian, and component bit depth encoded. (This has been removed in recent commits.) Replace the FourCC mess with a simple enum. Remove all the redundant formats like YV12/I420/IYUV. Replace some image format names by something more intuitive, most importantly IMGFMT_YV12 -> IMGFMT_420P. Add img_fourcc.h, which contains the old IDs for code that actually uses FourCCs. Change the way demuxers, that output raw video, identify the video format: they set either MP_FOURCC_RAWVIDEO or MP_FOURCC_IMGFMT to request the rawvideo decoder, and sh_video->imgfmt specifies the pixel format. Like the previous hack, this is supposed to avoid the need for a complete codecs.cfg entry per format, or other lookup tables. (Note that the RGB raw video FourCCs mostly rely on ffmpeg's mappings for NUT raw video, but this is still considered better than adding a raw video decoder - even if trivial, it would be full of annoying lookup tables.) The TV code has not been tested. Some corrective changes regarding endian and other image format flags creep in.
* vf_screenshot: simplifywm42013-01-131-52/+19
| | | | | | | | | | Instead of using a callback to "capture" the image next time the filter function is called, do it the other way around: on every filter invocation, create a reference to the image, and return it if a screenshot is requested. This also fixes the 1-frame delay when taking screenshots with the filter. This also allows simplifying screenshot.c.
* video/out: replace VFCAP_TIMER with vo->untimed, fix vo_image and vo_lavcwm42013-01-131-4/+2
| | | | | | | | VFCAP_TIMER disables any additional waiting done by mpv in the playloop. Remove VFCAP_TIMER, but re-use the idea for vo_image and vo_lavc. This means --untimed doesn't have to be passed when using --vo=image.
* video/filter: change filter API, use refcounting, remove filter DRwm42013-01-132-14/+44
| | | | | | | | | | | | | | | | | | | | Change the entire filter API to use reference counted images instead of vf_get_image(). Remove filter "direct rendering". This was useful for vf_expand and (in rare cases) vf_sub: DR allowed these filters to pass a cropped image to the filters before them. Then, on filtering, the image was "uncropped", so that black bars could be added around the image without copying. This means that in some cases, vf_expand will be slower (-vf gradfun,expand for example). Note that another form of DR used for in-place filters has been replaced by simpler logic. Instead of trying to do DR, filters can check if the image is writeable (with mp_image_is_writeable()), and do true in-place if that's the case. This affects filters like vf_gradfun and vf_sub. Everything has to support strides now. If something doesn't, making a copy of the image data is required.
* video: different way to enable hardware decoding, add software fallbackwm42013-01-132-0/+9
| | | | | | | | | | | | | | Deprecate the hardware specific video codec entries (like ffh264vdpau). Replace them with the --hwdec switch, which requests that a specific hardware decoding API should be used. The codecs.conf entries will be removed at a later time, but for now they are useful for testing and compatibility. Instead of --vc=ffh264vdpau, --hwdec=vdpau should be used. Add a fallback if hardware decoding fails. Most hardware decoders (including vdpau) support only a subset of h264, and having such a fallback is supposed to enable a better user experience.
* video: simplify decoder pixel format handlingwm42013-01-134-99/+3
| | | | | | | | | | | | | | | | | | | | Simplify the decoder pixel format handling by making it handle only the case vd_lavc needs: a video stream always decodes to a single pixel format. Remove the handling for multiple pixel formats, and remove the codecs.conf pixel format declarations that are left. Remove the handling of "ambiguous" pixel formats like YV12 vs. I420 (via VDCTRL_QUERY_FORMAT etc.). This is only a problem if the video chain supports I420, but not YV12, which doesn't seem to be the case anywhere, and in fact would not have any advantage. Make the "flip" flag a global per-codec flag, rather than a pixel format specific flag. (Some ffmpeg decoders still return a flipped image, so this has to be done manually.) Also fix handling of the flip operation: do not overwrite the global flip option, and make the --flip option invert the codec flip option rather than overriding it.
* video: remove slice based filtering and video outputwm42013-01-132-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Slices allowed filtering or drawing video in horizontal bands or blocks. This allowed working on the video in smaller units. In theory, this could bring a performance win by lowering cache pressure, as you didn't have to keep the whole video frame in cache while filtering, only the slice. In practice, the slice code path was barely used for the following reasons: - Multithreaded decoding with ffmpeg didn't use slices. The ffmpeg slice callback was disabled, because it can be called from another thread, and the mplayer video chain is not thread-safe. - There was nothing that would turn "full" images into appropriate slices, so slices were rarely used. - Most filters didn't actually support slices. On the other hand, supporting slices lead to code duplication and more complex code in general. I made some experiments and didn't find any actual measurable performance improvements when using slices. Even ffmpeg removed slices based filtering from libavfilter in favor of simpler code. The most broken thing about the slices code path is that slices can't be queued, like it is done for images in vo.c.
* Replace strsep() useswm42013-01-133-6/+22
| | | | | | This function sucks and apparently is not very portable (at least on mingw, the configure check fails). Also remove the emulation of that function from osdep/strsep*, and remove the configure check.
* core: timeline: prevent inaccurate seeks outside timelineUoti Urpala2013-01-131-2/+3
| | | | | | | | | Ensure that even if a seek is inaccurate it will not show video from outside the defined timeline. Previously, seeking to the beginning of a segment could show frames from before the start of the segment if the seek was done in inaccurate mode and the demuxer seeked to an earlier position. Now hr-seek machinery is used to skip at least the frames that should not be part of playback timeline at all.
* sub: do not apply timeline offset to external subtitleswm42013-01-121-3/+8
| | | | | | | | | | | | Now external subtitles essentially use the playback time, instead of the segment time. This is more useful when using external subtitles with mkv ordered chapters. The previous behavior is not necessarily incorrect, and e.g. makes it easier to use subtitles directly extracted from ordered chapters segments. But we consider the new behavior more useful. Also see commit 06e3dc8.
* Fix lots of bugs in mp_http URL handlingRudolf Polzer2013-01-101-2/+12
| | | | | Many instances of "http" were not changed to "mp_http", which made many aspects of the mp_http protocol handler broken.
* mplayer: make --loop loop the playlist instead of each playlist entrywm42013-01-092-32/+9
| | | | | | | | | | This is simpler and more useful. We could add a new switch for the old functionality, but that would probably be more confusing than helpful. When passing only a single file to the command line, this commit shouldn't change behavior. (Classic mplayer provided both features by duplicating the loop functionality in the "playtree".)
* mplayer: keep pause state when frame stepping in last framewm42013-01-091-0/+3
| | | | | | | When the last frame is displayed, and a frame step command is issued, playback ands and advances to the next file. But before this commit, the next file was played unpause. Fix this, and make sure pause is kept.
* sub: use correct fallback font for subtitleswm42013-01-061-1/+2
| | | | Accidentally still used the OSD font.
* sub: add --sub-text-* options to unstyled text subtitles fontwm42013-01-052-0/+4
| | | | | | | Before this commit, the --osd-* options (like --osd-font-size etc.) configured both the OSD and subtitle font. Make them separate, and add --sub-text-* options (like --sub-text-size etc.). Now --osd-* affects the OSD font only, and --sub-text-* unstyled text subtitles only.
* Update copyright yearwm42013-01-041-1/+1
|
* core: fix crash if VO init failswm42012-12-281-1/+1
|
* sdl, encode_lavc: fix copyright headersRudolf Polzer2012-12-282-4/+6