aboutsummaryrefslogtreecommitdiffhomepage
Commit message (Collapse)AuthorAge
* video: initial Matroska 3D supportGravatar wm42014-08-30
| | | | | | | | | | | | | | | | | | | | | This inserts an automatic conversion filter if a Matroska file is marked as 3D (StereoMode element). The basic idea is similar to video rotation and colorspace handling: the 3D mode is added as a property to the video params. Depending on this property, a video filter can be inserted. As of this commit, extending mp_image_params is actually completely unnecessary - but the idea is that it will make it easier to integrate with VOs supporting stereo 3D mogrification. Although vo_opengl does support some stereo rendering, it didn't support the mode my sample file used, so I'll leave that part for later. Not that most mappings from Matroska mode to vf_stereo3d mode are probably wrong, and some are missing. Assuming that Matroska modes, and vf_stereo3d in modes, and out modes are all the same might be an oversimplification - we'll see. See issue #1045.
* cache_file: add a mode that creates a temporary fileGravatar wm42014-08-30
| | | | | | | Since we have to be portable, our options for creating temporary files are somewhat limited. tmpfile() happens to be available everywhere, so use that. This function doesn't allow having a "visible" filename or location, so we use the magic string "TMP" for this.
* player: reduce default demuxer cacheGravatar wm42014-08-30
| | | | | | | A (hopefully) temporary hack to make stream switching delays tolerable. It's not clear how this should be handled (either executing a precise seek on track switching, or always enabling all streams), so get this issue out of the way for now by picking a rather low value.
* TOOLS/mpv_identify.sh: simplify $MPV handlingGravatar shdown2014-08-30
|
* TOOLS/mpv_identify.sh: various style improvementsGravatar shdown2014-08-30
| | | | | Double-quote everything, eliminate unneeded evals and deprecated `backtits` substitution syntax.
* TOOLS/mpv_identify.sh: move script body to a functionGravatar shdown2014-08-30
| | | | | Don't prepend each variable with __midentify__, just make them local to the function.
* TOOLS/youtube-dl_mpv.sh: simplify $MPV handlingGravatar shdown2014-08-30
|
* TOOLS/youtube-dl_mpv.sh: disable globbing before expanding $video_urlGravatar shdown2014-08-30
| | | | | $video_url can contain a question mark, which can be expanded to a character in an existing file name if globbing is enabled.
* manpage: document that --cache-file doesn't work with ordered chaptersGravatar wm42014-08-30
|
* stream: correctly propagate uncached stream typeGravatar wm42014-08-30
| | | | | This makes the ordered chapter code not think that a stream from the local filesystem is not a local file (it checks uncached_type).
* demux_lavf: print a warning if av_read_frame() returns an errorGravatar wm42014-08-30
| | | | Because why not.
* vf_softpulldown: handle null mpi_image correctlyGravatar shdown2014-08-30
| | | | Check if mpi is NULL before accessing mpi->fields.
* input: make ar_rate and ar_delay fields of input_ctx signedGravatar shdown2014-08-30
| | | | | ar_rate is set to -1 when autorepeat is disabled; there is no reason for ar_delay to stay unsigned.
* input: handle reaching MP_MAX_FDS correctlyGravatar shdown2014-08-30
| | | | Don't dereference fd and increment ictx->num_fds on fail.
* demux_mkv: eliminate redundant branchGravatar shdown2014-08-30
| | | | | | In the else branch pict_type is always 3, so pict_type != 3 is always false. (Note that I have no idea of what it was supposed to do and it is just an equivalent of the old behaviour.)
* demux: eliminate redundant checkGravatar shdown2014-08-30
| | | | | pkt can't be NULL since it's initialized from ds->head, which is checked at the beginning.
* demux_disc: handle new_sh_stream() fail correctlyGravatar shdown2014-08-30
| | | | | Break the cycle on fail. Old code was checking if sh is NULL after accessing it's fields.
* gl_wayland: fix crash after eglInitialze failedGravatar Alexander Preisinger2014-08-30
| | | | | Only execute most of the opengl termination procedure if we actually have an egl context.
* manpage: fix minor grammar issueGravatar wm42014-08-29
|
* vo_opengl: remove macro operator from shaderGravatar Bin Jin2014-08-29
| | | | Removes '##' operator from OpenGL shader code.
* TOOLS/youtube-dl_mpv: allow playing multiple URLsGravatar wm42014-08-29
| | | | | Unfortunately this also means you can't pass extra mpv options after the URL anymore. You can prefix the script with MPV='mpv --options' though.
* player: fix quit handling when seeking past EOF while pausedGravatar wm42014-08-29
| | | | | | | | | | The player didn't quit when seeking past EOF in audio-only mode while paused. The only case when we don't want to quit is when the last video frame is displayed while paused. This logic was probably broken a while ago, but I'm not exactly sure. CC: @mpv-player/stable
* Move compat/ and bstr/ directory contents somewhere elseGravatar wm42014-08-29
| | | | | | | | | bstr.c doesn't really deserve its own directory, and compat had just a few files, most of which may as well be in osdep. There isn't really any justification for these extra directories, so get rid of them. The compat/libav.h was empty - just delete it. We changed our approach to API compatibility, and will likely not need it anymore.
* bstr: preparation for next commitGravatar wm42014-08-29
| | | | | | | | Just so I can move this file without modifying its contents in the next commit. compat/compiler.h is to be moved to osdep/ with the next commit, so add a dummy header.
* stream: tweaks to network reconnection codeGravatar wm42014-08-29
| | | | | | | | | | | | | | Don't reconnect to the cache (since the cached stream already handles reconnection). This is necessary, because since commit 0b428e44 the "streaming" field (which also controls whether attempting to reconnect makes sense at all) is inherited to the cache stream wrapper. Also, let the stream reset its own position on reconnect. This removes some assumptions and messy handling from the reconnect function. Make sure the cache is dropped on reconnect. This takes care of readjusting the stream position if necessary. (Also drop the cache on DVB channel switching commands.)
* command: remove extra spaceGravatar Ryan Jacobs2014-08-29
| | | | Signed-off-by: wm4 <wm4@nowhere>
* options: more detailed output for --vf-... error messageGravatar wm42014-08-28
|
* command: export demuxer cache info propertiesGravatar wm42014-08-28
|
* player: update cache state only if requestedGravatar wm42014-08-28
| | | | | | | | | Add a mechanism to the client API code, which allows the player core to query whether a client API event is needed at all. Use it for the cache update. In this case, this is probably a pure microoptimization; but the mechanism will be useful for other things too.
* audio: restore old speed change behaviorGravatar wm42014-08-28
| | | | | | | | | | | | | | | | | | | | Don't attempt to resync after speed changes. Note that most other cases of audio reinit (like switching tracks etc.) still resync, but other code paths take care of setting the audio_status accordingly. This restores the old behavior of not trying to fix audio desync, which was probably changed with commit 261506e3. Note that the code as of now wasn't even entirely correct, since the A/V sync values are slightly shifted. The dsync depends on the audio buffer size, so a larger buffer size will show more extreme desync. Also see mplayer2 commit 213a224e, which should fixed this - it was not merged into mpv, because it disabled audio for too long, resulting in a worse user experience. This is similar to the issue this commit attempts to fix. Fixes: #1042 (probably) CC: @mpv-player-stable
* posix: use STD*_FILENO constantsGravatar Ben Boeckel2014-08-28
| | | | | Rather than "magic" numbers, use meaningful constant names provided by unistd.h.
* tv: initialize frequencies to 0Gravatar Ben Boeckel2014-08-28
|
* player: simplify chapter display name codeGravatar Ben Boeckel2014-08-28
| | | | | The display name is always recomputed, so we can always toss the input name.
* player: don't sort a NULL listGravatar Ben Boeckel2014-08-28
| | | | | This can occur if the directory does not have any files in it which causes files to never be non-NULL for qsort.
* vo_opengl: don't pass (char*)NULL as %s printf argumentGravatar wm42014-08-28
| | | | | | glGetString(GL_SHADING_LANGUAGE_VERSION) can return NULL; I suppose this happens on legacy OpenGL, while all the other fields are guaranteed to exist.
* vo_opengl: fix shaderGravatar wm42014-08-28
| | | | | | | | | | | | Regression since commit f14722a4. For some reason, this worked on nvidia, but rightfully failed on mesa. At least in C, the ## operator indeed needs two macro arguments, and you can't just concatenate with non-arguments. This change will most likely fix it. CC: @bjin
* player: dynamically change cache wait timesGravatar wm42014-08-27
| | | | | | | | | | | Remove the hardcoded wait time of 2 seconds. Instead, adjust the wait time each time we unpause: if downloading the data took longer than its estimated playback time, increase the amount of data we wait for. If it's shorter, decrease it. The +/- is supposed to avoid oscillating between two values if the elapsed time and the wait time are similar. It's not sure if this actually helps with anything, but it can't harm.
* player: slightly better cache underrun detectionGravatar wm42014-08-27
| | | | | | | | | | | | | | | | | | Use the "native" underrun detection, instead of guessing by a low cache duration. The new underrun detection (which was added with the original commit) might have the problem that it's easy for the playloop to miss the underrun event. The underrun is actually not stored as state, so if the demuxer thread adds a new packet before the playloop happens to see the state, it's as if it never happened. On the other hand, this means that network was fast enough, so it should be just fine. Also, should it happen that we don't know the cached range (the ts_duration < 0 case), just wait until the demuxer goes idle (i.e. read_packet() decides to stop). This pretty much should affect broken or unusual files only, and there might be various things that could go wrong. But it's more robust in the normal case: this situation also happens when no packets have been read yet, and we don't want to consider this as reason to resume playback.
* demux_lavf: don't reject av:// if cache is enabledGravatar wm42014-08-27
| | | | | Enabling the cache doesn't make much in this situation, but there's also no reason not to reject it.
* demux: reset idle state on seeksGravatar wm42014-08-27
|
* player: better cache status on status lineGravatar wm42014-08-27
| | | | | | | | | | | | | | The cache percentage was useless. It showed how much of the total stream cache was in use, but since the cache size is something huge and unrelated to the bitrate or network speed, the information content of the percentage was rather low. Replace this with printing the duration of the demuxer-cached data, and the size of the stream cache in KB. I'm not completely sure about the formatting; suggestions are welcome. Note that it's not easy to know how much playback time the stream cache covers, so it's always in bytes.
* player: fix basic playbackGravatar wm42014-08-27
| | | | | | | | | | | | | The "buffering" logic was active even if the stream cache was disabled. This is contrary to what the manpage says. It also breaks playback because of another bug: the demuxer cache is smaller than 2 seconds, and thus the resume condition never becomes true. Explicitly run this code only if the stream cache is enabled. Also, fix the underlying problem of the breakage, and resume when the demuxer thread stops reading in any case, not just on EOF. Broken by previous commit. Unbreaks playback of local files.
* player: redo how stream caching and pausing on low cache worksGravatar wm42014-08-27
| | | | | | | | | | | | | | | | | | | Add the --cache-secs option, which literally overrides the value of --demuxer-readahead-secs if the stream cache is active. The default value is very high (10 seconds), which means it can act as network cache. Remove the old behavior of trying to pause once the byte cache runs low. Instead, do something similar wit the demuxer cache. The nice thing is that we can guess how many seconds of video it has cached, and we can make better decisions. But for now, apply a relatively naive heuristic: if the cache is below 0.5 secs, pause, and wait until at least 2 secs are available. Note that due to timestamp reordering, the estimated cached duration of video might be inaccurate, depending on the file format. If the file format has DTS, it's easy, otherwise the duration will seemingly jump back and forth.
* demux: reduce wakeups if no cache is activeGravatar wm42014-08-27
| | | | | | | | | | | | The purpose of the unconditional pthread_cond_signal() when reading cached DEMUXER_CTRLs and STREAM_CTRLs was apparently to update the stream cache state. Otherwise, the cached fields would never be updated when the stream is e.g. paused. The same could be said about other CTRLs, but these aren't as important, since they are normally updated while reading packet data. In order to reduce wakeups, make this logic explicit.
* vo_opengl: add parameter to gaussian filterGravatar Bin Jin2014-08-26
| | | | | | | | | | Add a new parameter 'p' to gaussian filter. The new formula used a different base taken from fmtconv plugin, so that the new parameter is exactly same as the one used in Avisynth and Vapoursynth. The new default value is 2 / log(2) * 10, with the default value it conforms to the original kernel taken from vector-agg.
* vo_opengl: add radius options for filtersGravatar Bin Jin2014-08-26
| | | | | | | Add two new options, make it possible for user to set the radius for some of the filters with no fixed radius. Also add three new filters with the new radius parameter supported.
* vo_opengl: add cparam1 and cparam2 optionsGravatar Bin Jin2014-08-26
| | | | | | Although cscale is rarely used, it's possible that params of cscale are accidentally set to lparam1 and lparam2, which might cause unexpected results.
* vo_opengl: add spline64 filter kernelGravatar Bin Jin2014-08-26
| | | | | | | | The coefficients are taken from fmtconv plugin for vapoursynth: https://github.com/vapoursynth/fmtconv/blob/master/src/fmtc/ContFirSpline64.cpp The package is licensed under WTFPL, and it's from the same author of Dither plugin for avisynth.
* TOOLS: youtube wrapper: allow overriding mpv binaryGravatar wm42014-08-26
|
* player: fix weird behavior when framestepping over format changesGravatar wm42014-08-26
| | | | | | | | | | When video format changes, the frame before the frame with the new format sets video_status briefly to STATUS_DRAINING. This caused the code to handle the EOF case to kick in, which just pauses the player when trying to step past the last frame. As a result, trying to framestep over format changes resulted in pausing the player. Fix by testing against the correct status.