summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* player: don't set tag strings to NULLwm42015-01-121-3/+3
| | | | | | | | | | | | | bstr is a bounded string type, consisting of a pointer and a length value. If the length is 0, the pointer can be NULL. This is somewhat logical due to how this abstraction works, but it can leak when converting to C strings. talloc_strndup() returns NULL instead of "" in this case, which broke some other code. Use bstrto0() instead, which is the "proper" function to convert bstr to char*. Fixes #1462.
* demux_mkv: fix EBML parsing checkswm42015-01-121-16/+15
| | | | | | | | Reading IDs must be checked too. This was basically forgotten in commit f3a978cd. Also set the *length parameter for ebml_parse_length() in some error cases, which _really_ should happen. Fixes #1461.
* manpage: improve --title descriptionwm42015-01-121-5/+6
| | | | | It might be rather surprising that --title also sets the audio stream title (for PulseAudio and wasapi), so it certainly should be mentioned.
* tl_matroska: fix minor memory leak in error casewm42015-01-121-5/+7
| | | | Going the way of least resistance. Fixes #1460.
* player: check sufficient track selection before destroying VOwm42015-01-121-9/+9
| | | | | | | | | | | | | | | | mpv needs at least an audio or video track to play something. If the track selection is basically insufficient, the player will immediately skip to the next file (or quit). One slightly annoying thing might be that trying to play a subtitle file will close the VO window, and then go to the next file immediately (so "mpv 1.mkv 2.srt 3.mkv" would flash the video window when 2.srt is skipped). Move the check to before the video window is possibly closed. This is a minor cosmetic issue; one can use --force-window to avoid closing the video window at all. Fixes #1459.
* client API: reasonable behavior if window is closedwm42015-01-121-0/+2
| | | | | | | | | | | | | | | | Closing the video window sends CLOSE_WIN, which is normally mapped to the "quit" command. The client API normally disables all key bindings, and closing the window does nothing. It's simply left to the application to handle this. This is fine - an embedded window can not be destroyed by user interaction. But sometimes, the window might be destroyed anyway, for example because the containing window is destroyed. If this happens, CLOSE_WIN should better not be ignored. We can't expect client API users to handle this specially (by providing their own input.conf), so provide some fallback for this pseudo key binding. The "quit" command might be too intrusive (not every client necessarily handles "unexpected" MPV_EVENT_SHUTDOWN), but I think it's still reasonable.
* x11: explicitly query map status when waiting for map eventwm42015-01-121-0/+6
| | | | | | | | For some reason, mpv sometimes does not get a MapNotify event with GtkSocket embedding. This happens maybe 1 out of 10 times. I'm not sure how this can happen - it certainly shouldn't. Since I was not able to find the cause, and causes an apparent "deadlock", here's a lazy hack to fix the misbehavior.
* x11: support XEmbedwm42015-01-122-6/+58
| | | | | | | | | | | | Seems to work with GtkSocket and passing the gtk_socket_get_id() value via "wid" option to mpv. One caveat is that using <tab> to move input focus from mpv to GTK does not work. It seems we would have to interpret <tab> ourselves in this case. I'm not sure if we really should do this - it would probably require emulating some other typical conventions too. I'm not sure if an embedder could do something about this on the toolkit level, but in theory it would be possible, so leave it as is for now.
* vo: don't synchronize when seekingwm42015-01-121-1/+7
| | | | | | | | | Don't use vo_control() for sending VOCTRL_RESET when starting a seek. This means vo_seek_reset() won't wait until the VO actually processed VOCTRL_RESET. It happens asynchronously instead. The impact of this change should be minimal, unless the VO is somehow too busy (like blocking on vsync).
* player: change --display-tags behaviorwm42015-01-122-8/+18
| | | | | | | | | | | | | | | | | | Remove the "all" special-behavior, and instead interpret trailing "*" characters. --display-tags=all is replaced by --display-tags=* as a special-case of the new behavior. See #1404. Note that the most straight-forward value for matchlen in the normal case would be INT_MAX, because it should be using the entire string. I used keylen+1 instead, because glibc seems to handle this case incorrectly: snprintf(buf, sizeof(buf), "%.*s", INT_MAX, "hello"); The result is empty, instead of just containing the string argument. This might be a glibc bug; it works with other libcs (even MinGW-w64).
* demux_mkv: better check for some EBML parsingwm42015-01-121-15/+19
| | | | | | | | | | Apparently, originally this code was meant to be able to read past the buffer somewhat, which is why the buffer allocation was padded by 8 byte. This is unclean and confuses valgrind. This probably could have crashed with certain invalid files too. Also revert the change added with 10a2f69; it should be not needed anymore.
* demux_mkv: avoid endless loop with broken fileswm42015-01-121-1/+1
| | | | Fixes #1457.
* ao_pulse: exit AO if stream failswm42015-01-111-1/+5
| | | | | | This can for example reproduced by killing the pulseaudio server. If this happens, just try to reload the AO, instead of breaking everything forever.
* win32: drop hacks for possibly broken static pthreads-win32 linkingwm42015-01-113-19/+0
| | | | | | | | | | | | We now use threads and other pthread API a lot, and not always we use it from threads created with pthread_create() (or the main thread). As I understand, with static linking we would have to use pthread_win32_thread_attach/detach_np() every time we enter or leave a foreign thread. We don't do this, and it's not feasible either, so it's just broken. This still should work with dynamic pthreads-win32. The MinGW pthread implementation should be unaffected from all of this.
* command: fix property naming conventionwm42015-01-102-4/+4
| | | | Use "-" instead of "_" as separator.
* command: change properties added in previous commitwm42015-01-103-16/+19
| | | | | | | | | | | | | Make their meaning more exact, and don't pretend that there's a reasonable definition for "bits-per-pixel". Also make unset fields unavailable. average_depth still might be inconsistent: for example, 10 bit 4:2:0 is identified as 24 bits, but RGB 4:4:4 as 12 bits. So YUV formats seemingly drop the per-component padding, while RGB formats do not. Internally it's consistent though: 10 bit YUV components are read as 16 bit, and the padding must be 0 (it's basically like an odd fixed- point representation, rather than a bitfield).
* command.c: new subproperties for video-params: bpp and depthxylosper2015-01-102-0/+18
| | | | | | | | bpp(bits-per-pixel) and depth(bit-depth for color component) can be calculated from pixelformat technically but it requires massive informations to be implemented in client side. These subproperties are provided for convenience.
* player: enable demuxer thread for external audio fileswm42015-01-101-0/+9
| | | | | | | | | | | | | | Enable asynchronous reading for external files. This excludes subtitle files (so it's effectively enabled for audio files only), because most subtitle files are fully read on loading, and running a thread for them would just cause slowdowns and increase resource usage, without having any advantages. In theory, an external file could provide multiple tracks from the same demuxer, but demux_start_thread() is idempotent, so the code can be kept simple. Should help with playing DASH with ytdl_hook.
* player: change stream list terminal outputwm42015-01-091-2/+2
| | | | | Move the stream selection marker "(+)" to the beginning, and drop the "[stream]" prefix. Make the edition output line up with it too.
* DOCS/client_api_examples: qml_direct: QWindow::size() is not thread-safewm42015-01-092-3/+4
| | | | | | We still keep the window pointer, because we want to call QQuickWindow::resetOpenGLState() (which runs on the rendering thread only). Interesting mess...
* DOCS/client_api_examples: qml: reduce number of fileswm42015-01-094-119/+116
| | | | This is annoying.
* ao_alsa: fix dtshd passthroughwm42015-01-091-2/+6
| | | | | | | We must not try to remap channels with this. Whethever ALSA gives us, and whatever we do with it, the result will probably be nonsense. Untested, as I don't have the required hardware.
* DOCS/compile-windows.md: fix pkg-config directoryJames Ross-Gowan2015-01-091-2/+4
|
* video: Add sigmoidal upscaling to avoid ringing artifactsNiklas Haas2015-01-094-2/+69
| | | | | | | | | This avoids issues when upscaling directly in linear light, and is the recommended way to upscale images according to imagemagick. The default slope of 6.5 offers a reasonable compromise between ringing artifacts eliminated and ringing artifacts introduced by sigmoid-upscaling. Same goes for the default center of 0.75.
* demux_mkv: improve robustness against broken libavcodec parserswm42015-01-091-2/+2
| | | | | | | | | The VP9 codec parser has a bug: it doesn't set the data/size pointers passed to it. As I understand, it must always do this, and in fact, if it doesn't some libavcodec generic code would be in trouble too. This helps with #1448, but is not the full fix for it. The codec parser must be fixed in libavcodec itself.
* tl_matroska: check chapter boundswm42015-01-091-2/+7
| | | | | | | I have no idea what this does, but it's without doubt a sufficient fix for the issue at hand. Fixes #1445.
* vo_opengl_cb: make mpv_opengl_cb_render() return left framesxylosper2015-01-082-3/+4
| | | | | | Instead of error code which was not helpful because it's always 0, mpv_opengl_cb_render() returns the number of left frames in the frame queue now.
* vo_opengl_cb: use vo's drop_count instead of internal counterxylosper2015-01-081-6/+15
| | | | | This commit makes it possible to query dropped frames by opengl-cb through vo-drop-frame-count property.
* vo: add functions to increment drop_countxylosper2015-01-082-0/+8
| | | | | Add two functions which increment drop_count thread-safely. This is for the commit followed.
* vo_opengl_cb: introduce frame queuexylosper2015-01-082-19/+110
| | | | | | | | | | | | | | | | | | | | | | | | | The previous implementation of opengl-cb kept only latest flipped frame. This can cause massive frame drops because rendering is done asynchronously and only the latest frame can be rendered. This commit introduces frame queue and releated options to opengl-cb. frame-queue-size: the maximum size of frame queue (1-100, default: 1) frame-drop-mode: behavior when frame queue is full (pop, clear, default: pop) The frame queue holds delayed frames and drops frames if the frame queue is overflowed with next method: 'pop' mode: drops all the oldest frames overflown. 'clear' mode: drops all frames in queue and clear it. With default options(frame-queue-size=1:frame-drop-mode=pop), opengl-cb behaves in the same way as previous implementation effectively. For frame-queue-size > 1, opengl-cb tries to calls update() without waiting next flip_page() in order to consume queued frames. Signed-off-by: wm4 <wm4@nowhere>
* win32: minor simplificationwm42015-01-081-3/+2
| | | | The events parameter is not needed here and won't ever be.
* vo_opengl: don't crash win32 backend with NULL eventswm42015-01-081-7/+7
| | | | | | | | | vo_opengl was crashing since f811348d because it passed NULL for the events parameter to vo_control. Normally the parameter should not be NULL, so add a hack to account for this. In particular, we should handle the events that are returned. For the call in preinit() we skip this, but it most likely has no meaning anyway, because in this stage no window is visible yet.
* vo_opengl_cb: fix a typowm42015-01-081-2/+2
|
* vo_opengl_cb: allow changing debug option at runtimewm42015-01-081-0/+1
| | | | | | | This was always supposed to work. Just add the option declaration. Normally I'm not a fan of duplicating such things, but in this case it's (still) harmless.
* DOCS: add instructions for building with MSYS2James Ross-Gowan2015-01-082-91/+209
| | | | | | mpv can be built natively on a Windows machine using MSYS2. Add detailed instructions on how to build and merge them with the existing instructions for cross-compilation.
* DOCS/client_api_examples: add an alternative qml examplewm42015-01-086-0/+293
| | | | | | | | | | | This one avoids use of a FBO. It's less flexible, because it uses works around the whole QML rendering API. It seems to be the only way to get OpenGL rendering without any indirections, though. Parts of this example were insipired by Qt's "Squircle" example. Also add a README file with a short description of each example, to reduce the initial confusing.
* vo_opengl_cb: fix flipped renderingwm42015-01-081-0/+1
| | | | Oops.
* vo_opengl: gl_lcms: implement change detection for memory profileswm42015-01-083-0/+26
| | | | | | | | | | This affects OSX, where memory profiles are updated e.g. on fullscreen switches. The profile most likely doesn't change, but the LUT will be generated and reloaded anyway. Somewhat of a regression from commit f811348. Fixes #1439.
* vo_opengl: gl_lcms: fix potential dangling pointer issuewm42015-01-081-4/+5
| | | | | | | If icc-path is set, but the thing is replaced with a memory profile, then p->icc_path would point to deallocated memory. Also, the NULL checks are unnecessary.
* ao: remove coreaudio_exclusive from autoprobing listwm42015-01-071-2/+2
| | | | Apparently this was a mistake.
* ao_pulse: disable latency calculation hacks by defaultwm42015-01-072-3/+7
| | | | | | | | | | | | | | This used to be required to workaround PulseAudio bugs. Even later, when the bugs were (partially?) fixed in PulseAudio, I had the feeling the hacks gave better behavior. On the other hand, I couldn't actually reproduce any bad behavior without the hacks lately. On top of this, it seems our hacks sometimes perform much worse than PulseAudio's native implementation (see #1430). So disable the hacks by default, but still leave the code and the option in case it still helps somewhere. Also, being able to blame PulseAudio's code by using its native API is much easier than trying to debug our own (mplayer2-derived) hacks.
* vo_direct3d: fix shader colormatrix generationwm42015-01-071-5/+5
| | | | It was accidentally broken in d42d60bc1.
* win32: request UTF-16 API variants, Vista+ APIs, and COM C macroswm42015-01-0713-28/+11
| | | | | Put the Vista+ (_WIN32_WINNT) and the COM C (COBJMACROS) defines into the build system, instead of defining them over and over in the code.
* x11: always use glXGetProcAddressARB()wm42015-01-071-1/+1
| | | | | | | | | | glXGetProcAddress() is outdated, and as far as I know doesn't give all the guarantees the "new" ARB function gives. Probably doesn't matter too much, because until now it always appeared to work. On the other hand, since this function is (bogusly) used only on the gl3 code path, it could have happened that users hit this, and just reverted to vo_opengl_old instead.
* terminal: always print to stderr with --no-input-terminalwm42015-01-071-5/+6
| | | | | | | | | | | | | | | | | The function terminal_in_background() reports whether the player was backgrounded. In this case, we don't want to annoy the user by still printing the status to stderr. If no terminal interaction is assumed, this mechanism is disabled, and stderr is always used. The read_terminal variable signals this case. Oddly, just redirecting stderr will disable output to stderr, because the background check with tcgetpgrp() is done on stderr, but read_terminal is still true (because that one depends on stdin and stdout). Explicitly disable this mechanism if --no-input-terminal is used by setting read_terminal to true only if terminal input is actually initialized.
* gl_video.c: invalidate image_params in uninit_video()xylosper2015-01-071-0/+4
| | | | | | | | | | | | | When the given mp_image_params does not match with that of gl_video, gl_video_config() always calls uninit_video() but calls init_video() only if valid format is given. Since uninit_video() does not change image_params of gl_video, when the same params as the previous one is given to gl_video_config() after gl_video is unitialized with invalid format, gl_video_config() never calls init_video(). To prevent this, invalidate image_params of gl_video in uninit_video().
* vo_opengl: add support for in memory icc profilesStefano Pigozzi2015-01-075-172/+132
| | | | | | | | | | | Previously we just forced loading a profile from file, but that has poor integration for querying the OS / display server for an ICC profile, and generating profiles on the fly (which we might use in the future for creating preset 3dluts). Also changed the previous icc-profile-auto code to use this mechanism, and moved gl_lcms to be an opaque type with state instead of just providing pure functions.
* video: Remove some stale CMS code, minor cosmeticsNiklas Haas2015-01-073-17/+6
| | | | This removes an old code path that was disabled in 016bb14.
* dxva2: copy mp_image attributes to sw_imgJames Ross-Gowan2015-01-071-0/+1
|
* mp_image: copy missing attributesJames Ross-Gowan2015-01-071-0/+2
| | | | | This adds a couple of missing fields to mp_image_copy_attributes so things like rotation metadata work.
* stream_pvr: uncrustifywm42015-01-061-1306/+1188
| | | | Mostly automatic, with some manual changes.
* dvb: uncrustifywm42015-01-063-1272/+1261
| | | | Mostly automatic, some manual changes.
* stream_dvb: Enable streaming mode, activates cache.Oliver Freyermuth2015-01-061-0/+1
| | | | | | | | | This causes more constant reading from the DVB device, and seems not to hurt the stream-controls. As the device cache seems to fill up when not reading from it for several seconds, reading into the cache fixes desync-issues after the initial analyzeduration of the demuxer.
* stream_dvb: Do not add special PIDs if we anyways record the full TP.Oliver Freyermuth2015-01-061-23/+22
| | | | | | This just exchanges two blocks of code: If we record the full transponder, no need to explicitly add some PIDs to the filter list.
* stream_dvb: Add possibility to dump a full transponder.Oliver Freyermuth2015-01-063-4/+22
| | | | | | | | | | | | Was already possible before by injecting the magic PID 8192 into channels.conf, the flag makes this much more useable and we also have it documented. Useful not only for debugging, but also for incomplete channels.conf (mplayer format...), multi-channel recording, or channels which do dynamic PID switchng. full-transponder is also useful for channels which switch PIDs on-the-fly. ffmpeg can handle this, but it needs the full stream with all PIDs.
* manpage: dvb: Add some information on VDR channel list support.Oliver Freyermuth2015-01-061-0/+6
| | | | Only really helpful for DVB-S for now.
* stream_dvb: Record PIDs with human-readable content, bump max demuxer count.Oliver Freyermuth2015-01-062-1/+15
| | | | | | | | | | | There is the STD which contains service-names (ffmpeg can understand it), and the EIT which contains the EPG (ffmpeg does not parse it, but e.g. VLC does). As we now have more PIDs in general, increase the maximum number of demuxers we can open. ffmpeg has an internal limit of 64 PIDs, we are still far from that.
* stream_dvb: Also demux PMT if possible, reactivate TPID parsing.Oliver Freyermuth2015-01-064-12/+113
| | | | | | | | | | | | If VDR-channel-config is used, we know the service_id. Using that, PMT can be extracted from PAT (code for that inspired by szap-s2 again). For this, we need to demux PAT with a special filter-setup, and once PMT was found it can be added to the PID-list. PMT is only resolved the first time one tunes to a channel, then stored in the channel-list in memory. With PMT available, ffmpeg can safely decode the teletext-pids.
* stream_dvb: Extend token-list for pid-parsing, magically allows to parse ↵Oliver Freyermuth2015-01-061-3/+33
| | | | | | | | | | | VDR-style PID-lists. I also added a comment explaining the potentially occuring structures for future reference. For tokenization, a custom strtok_r implementation is used, inspired by strtok_r as implemented in musl and ffmpeg, hopefully slightly more readable (av_strtok_r is not available in libav, and strtok_r is not available everywhere).
* stream_dvb: Move out PID-parsing, disable TPID parsing.Oliver Freyermuth2015-01-061-26/+38
| | | | | | | Move PID-string parsing into a separate function, reduces code-duplication. Drop TPID-parsing again since teletext-stream seems not really correctly identified (ffmpeg guessed mp3 in my test...). Parsing now done using strtok + sscanf instead of sscanfs with fixed numbers of expected fields - gives more correct checking of PID-overflow, will allow VDR-style PID-field parsing.
* stream_dvb: Add TPID (teletext-pid) parsing from VDR-style channel-lists.Oliver Freyermuth2015-01-061-23/+28
| | |