summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* sub: do charset conversion in demux_lavf.cwm42015-12-283-48/+21
| | | | | | | | | | | | | Just so I can remove a few lines from dec_sub.c. This is slightly inelegant, as the whole subtitle file has to be read into memory, converted at once in memory, and then provided to libavformat in an awkward way by creating a memory stream instead of using demuxer->stream. It also won't be possible to force the charset on subtitles in binary container formats - but this wasn't exposed before, and we just hope this won't be ever needed. (One motivation was fixing broken files with non-UTF8 muxed.) It also won't be possible to change the charset on the fly, but this was not exposed either.
* demux_lavf: prepare for using wrapper stream instancewm42015-12-281-14/+20
| | | | Preparation for the next commit.
* wayland: fix typo in error messageAlessandro Ghedini2015-12-271-1/+1
|
* sub: refactor initializationwm42015-12-277-151/+86
| | | | | | | | Just simplify by removing parts not needed anymore. This includes merging dec_sub allocation and initialization (since things making initialization complicated were removed), or format support queries (it simply tries to create a decoder, and if that fails, tries the next one).
* sub: minor refactor how video FPS for MicroDVD is setwm42015-12-275-29/+30
| | | | | | | | | So that the video FPs is not required at initialization, and can be set later. (As for whether this MicroDVD crap is worth the trouble to handle it "correctly": MicroDVD files are unfortunately still around, and in at least one case using the video FPS seemed to help indeed.)
* demux_mkv: adjust subtitle preroll defaultswm42015-12-272-5/+22
| | | | | | | | | | | | | | | | | Always preroll by default if the cue (index) information indicates overlapping subtitles. Increase the amount of maximum data it will skip to get such subtitles to 10 seconds. Since the index information can reliably tell whether reading earlier is needed, the maximum should be rarely actually used, thus we can set it high. On the other hand, the "old" prerolling mechanism always has to skip the maximum amount of data; thus the method using the index gets its own option to control the maximum amount of data to skip. (As more and more files With newer mkvtoolnix versions are muxed, and with this new and hopefully sane default established, these options can probably be removed in the future.)
* README: remove pointer to homebrew-mpvStefano Pigozzi2015-12-261-4/+0
|
* vo_rpi: fix previous commitwm42015-12-261-1/+1
| | | | Meh. Fixes #2639.
* vo_rpi: fix compilationwm42015-12-262-6/+2
| | | | | | | | | Untested, but should be fine. Broken by commit 0a0bb905. Also fix the include statement in context_rpi.c, which caused another compilation failure. Also untested. (Because I'm lazy.) Fixes #2638.
* filter_kernels: use more precise parameters for robidoux filterswm42015-12-261-4/+10
| | | | See #2637.
* vo_opengl: fix gray playbackwm42015-12-261-4/+3
| | | | | | Commit f24ba544 wasn't an equivalent change. (This shit needs some sort of automated tests.)
* command: replace ROUND() with lrint()wm42015-12-262-7/+4
| | | | | lrint() pretty much does what ROUND() is supposed to do, but it's more precise.
* sub: destroy/recreate ASS_Renderer when disabling/enablings subswm42015-12-265-8/+34
| | | | | | | Keeping ASS_Renderers around for a potentially large number of subtitle tracks could lead to excessive memory usage, especially since the libass cache is broken (caches even unneeded data), and might consume up to ~500MB of memory for no reason.
* sub: always recreate ASS_Renderer on subtitle decoder reinitwm42015-12-268-150/+75
| | | | | | | This includes the case of switching ordered chapter boundaries. It will now be recreated on each timeline part switch. This shouldn't be much of a problem with modern libass. (Older libass versions use fontconfig for memory fonts, and will be very slow to reinitialize memory fonts.)
* sub: cache subtitle state per track instead of per demuxer streamwm42015-12-266-49/+31
| | | | | | | | | | | | Since commit 6d9cb893, subtitle state doesn't survive timeline switches (ordered chapters etc.). So there is no point in caching the state per sh_stream anymore (which would be required to deal with multiple segments). Move the cache to struct track. (Whether it's worth caching the subtitle state just for the situation when subtitle tracks get reselected is questionable. But for now, it's nice to have the subtitles immediately show up when reselecting a subtitle.)
* vo_opengl: flip image if backend uses flipped renderingwm42015-12-251-0/+2
| | | | Should fix #2635 (untested).
* command: change heuristic for files with 1 chapterwm42015-12-251-2/+3
| | | | | | | | | For files with only 1 chapter, the "cycle" command was ignored. Reenable it, but don't let it terminate playback of the file. For the full story, see #2550. Fixes #2550.
* player: fix previous commitwm42015-12-251-11/+17
| | | | | | | OK, this made the --sub-paths and --audio-file-paths synonyms, which is not what we wanted. Actually restrict the type of file loaded as well. Really fixes #2632.
* options: add --audio-file-pathswm42015-12-254-16/+29
| | | | | | | | Requested. It works like --sub-paths. This will also load audio files from a "audio" sub directory in the config file (because the same code as for subtitles is used, and it also had such a feature). Fixes #2632.
* sub: clear subtitle list when crossing timeline boundarywm42015-12-253-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When crossing timeline boundaries (such as switching to a new segment or chapter with ordered chapters), clear the internal text subtitle list. This breaks the sub-seek command, but is otherwise not too harmful. Fixes Sub-OC-test-final7.mkv. (The internal text subtitle list is basically a cache to make subtitles show up at the right time when seeking back.) I suspect this was caused by 76fcef61. The sample file times subtitles slightly before the video frame when it should show up. This is to avoid problems with subtitles showing up a frame later than intended. It also means that a subtitle which is supposed to show up on the start of a timeline part boundary actually might first be shown in a different part. Since we now manipulate the packet timestamps, instead of manipulating timestamps after the subtitle decoder, this means this subtitle event would have 2 timestamps, which our code of course does not handle. If the two parts come one after another, this would actually work (since the subtitle would have the same timestamps in the old and new part), but it breaks if the new part (which follows the old part in the physical file) is has a completely different start time in the timeline. Essentially, the trick used to time subtitles correctly is incompatible with the way we cache subtitles (to make them survive seeks). The simple solution is just clearing the cached subtitles when crossing chapter boundaries.
* command: fix eof-reached property change notification in corner caseswm42015-12-241-2/+2
| | | | | | | | | See #2609: "When eof is reached it would be shown on the OSD and in the console. Next try seeking to the middle. Seeking to the middle of the file will only result in the OSD message being updated. Lua seems to fail to observe the change in the property until the video is unpaused."
* sub: use macros to remove code duplicationwm42015-12-241-49/+31
| | | | Meh.
* sub: merge bitmap render functions into one for each kindwm42015-12-241-84/+45
| | | | | | | | | | Merge blend_src8_alpha and blend_src16_alpha into blend_src_alpha, and the same for blend_const_alpha. One thing that changes is that the vertical loop is now shared for both code paths. I think this is slightly easier to read, and it's a bit shorter as well.
* sub: remove "inaccurate" code pathwm42015-12-241-10/+0
| | | | | | The "accurate" one always has been enabled, and I can't find much evidence that the "inaccurate" one is much faster on my particular machine anyway.
* sub: find GBRP format automatically when rendering to RGBwm42015-12-244-23/+17
| | | | | | | | | | | | | | | | This removes the need to define IMGFMT_GBRAP, which fixes compilation with the current Libav release. This also makes it automatically pick up a GBRP format with the same bit width. (Unfortunately, it seems libswscale does not support conversion to AV_PIX_FMT_GBRAP16, so our code falls back to 8 bit, removing precision for video covered by subtitles in cases this code is used.) Also, when the source video is e.g. 10 bit YUV, upsample to 16 bit. Whether this is good or bad, it fixes behavior with alpha. Although I'm not sure if the alpha range is really correct ([0,2^16-1] vs. [0,255*256]). Keep in mind that libswscale doesn't even agree with the way we do it.
* vo_opengl: fix operation on GLSL versions earlier than 1.30wm42015-12-241-1/+1
| | | | | GLSL below version 1.30 does not support mix() with a boolean interpolation value. Use ?: instead. Untested, but probably works.
* sub: better alpha blending when rendering to alpha surfaceswm42015-12-243-1/+37
| | | | | | | | | | | This actually treats destination alpha correctly, and gives much better results than before. I don't know if this is perfectly correct yet, though. Slight difference with vo_opengl behavior suggests it might not be. Note that this does not affect VOs with true alpha support. vo_opengl does not use this code at all, and does the alpha calculations in OpenGL instead.
* vo_opengl: fall back to gcc thread local storage (2)wm42015-12-231-1/+0
| | | | | | | | | | | | Commit 1a6f3c56 added a fallback for the case when C11 TLS was not available, but GCC TLS was. But it forget to enable VAAPI EGL interop in the build system in this case. Just remove the build system check. Should someone find a compiler that works on Linux and does not support GCC extensions or C11, it will still compile and just fail to init at runtime. Actually fixes #2631 (hopefully).
* demux_mf: fix previous commitwm42015-12-231-5/+7
| | | | It was total crap.
* demux: remove weird tripple-buffering for the sh_stream listwm42015-12-2313-146/+199
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The demuxer infrastructure was originally single-threaded. To make it suitable for multithreading (specifically, demuxing and decoding on separate threads), some sort of tripple-buffering was introduced. There are separate "struct demuxer" allocations. The demuxer thread sets the state on d_thread. If anything changes, the state is copied to d_buffer (the copy is protected by a lock), and the decoder thread is notified. Then the decoder thread copies the state from d_buffer to d_user (again while holding a lock). This avoids the need for locking in the demuxer/decoder code itself (only demux.c needs an internal, "invisible" lock.) Remove the streams/num_streams fields from this tripple-buffering schema. Move them to the internal struct, and protect them with the internal lock. Use accessors for read access outside of demux.c. Other than replacing all field accesses with accessors, this separates allocating and adding sh_streams. This is needed to avoid race conditions. Before this change, this was awkwardly handled by first initializing the sh_stream, and then sending a stream change event. Now the stream is allocated, then initialized, and then declared as immutable and added (at which point it becomes visible to the decoder thread immediately). This change is useful for PR #2626. And eventually, we should probably get entirely of the tripple buffering, and this makes a nice first step.
* input: add a catch-all "unmapped" commandwm42015-12-234-1/+14
| | | | | | This can be used to grab all unmapped keys. Fixes #2612.
* input: add key name to script-binding command responsewm42015-12-235-13/+20
| | | | | | | | | | | | | | | | The "script-binding" command is used by the Lua scripting wrapper to register key bindings on the fly. It's also the only way to get fine- grained information about key events (such as separate key up/down events). This information is sent via a "key-binding" message when the state of a key changes. Extend it to send name of the mapped key itself. Previously, it was assumed that the user just uses an unique identifier for the binding's name, so it wasn't needed. With this change, a user can map exactly the same command to multiple keys, which is useful especially with the next commit. Part of #2612.
* old-configure: add a missing definewm42015-12-231-0/+1
| | | | (Why am I maintaining 2 build systems?)
* vo_opengl: fall back to gcc thread local storagewm42015-12-231-1/+7
| | | | | | | | | | | | gcc 4.8 does not support C11 thread local storage. This is a bit annoying, so add a hack to use the gcc specific __thread extension if C11 TLS is not available. (This is used for the extremely silly mpv-internal way hwdec modules access some platform specific handles. Disabling it simply made hwdec_vaegl.c always fail initialization.) Fixes #2631.
* CONTRIBUTING.md: add some more hintswm42015-12-231-0/+6
|
* player: minor simplificationwm42015-12-232-5/+3
| | | | This tmp thing had not much of a purpose anymore.
* CONTRIBUTING.md: add missing wordswm42015-12-221-1/+1
|
* stream_lavf: remove tabswm42015-12-221-2/+2
| | | | Death to tabs.
* vo_opengl: blend transparent video against tiles by defaultwm42015-12-222-6/+13
| | | | | | | | | | | Add a "blend-tiles" choice to the "alpha" sub-option. This is pretty simplistic and uses the GL raster position to derive the tiles. A weird consequence is that using --vo=opengl and --vo=opengl-hq gives different scaling behavior (screenspace pixel size vs. source video pixel size 16x16 tiles), but it seems we don't have easy access to the original texture coordinates. Using the rasterpos is probably simpler. Make this option the default.
* Add a CONTRIBUTING.md filewm42015-12-222-9/+33
| | | | | | | | | Github will display a link to it when a user wants to create an issue or pull request. Also make some minor adjustments to DOCS/contribute.md, which is developer oriented, and for which I see no reason to merge it with the new file.
* tests: fix #includeIlya Tumaykin2015-12-221-1/+1
|
* input.conf: remove a redundant and a broken examplewm42015-12-221-2/+0
| | | | | | | window-scale is now mapped to Alt+0 etc. by default (although these bindings just use "set", not "cycle-values"). colormatrix can't be cycled anymore (would require using vf_format).
* input.conf: erase `audio-delay` from `Not assigned by default`openingnow2015-12-221-2/+0
| | | | | | | `ctrl+ +`is assigned as `add audio-delay` by default. Tested by running `mpv --input-test --force-window --idle` Signed-off-by: wm4 <wm4@nowhere>
* dec_sub: avoid segfault on sub_init_decoder failureAman Gupta2015-12-221-1/+2
| | | | | | Broken by commit 687b552d. Signed-off-by: wm4 <wm4@nowhere>
* demux_lavf: rename to handle_new_stream to clarify intentAman Gupta2015-12-221-2/+2
|
* ao_wasapi: fix delay calculationKevin Mitchell2015-12-211-21/+36
| | | | | | | | | | | | | | | | | | | Make sure that subtraction of performance counters is done correctly. Follow the *exact* instructions for converting performance counter to something comparable to the QPCposition returned by IAudioClient::GetPosition https://msdn.microsoft.com/en-us/library/windows/desktop/dd370889%28v=vs.85%29.aspx Also make sure that subtraction of unsigned integers is stored into a signed integer to avoid nastiness. Also be more careful about overflow in the conversion of the device position into number of samples. Avoid casting mp_time_us() to a double, and use llrint to convert the double precision delay_us back to integer for ao_read_data. Finally, actually check the return value of ao_read_data and add a verbose message if it is not the expected value. Unfortunately, there is no way to tell WASAPI when this happens since the frame_count in ReleaseBuffer must match GetBuffer.
* demux_lavf: make trace output for mp_seek easier to digestAman Gupta2015-12-211-1/+4
| | | | Signed-off-by: wm4 <wm4@nowhere>
* Fix some typos in code commentsAman Gupta2015-12-213-3/+3
| | | | Signed-off-by: wm4 <wm4@nowhere>
* vf_yadif: change defaultswm42015-12-214-6/+11
| | | | | | | | | | | | | | | | This is for the sake of command.c and the "deinterlace" option/property. Instead of forcing certain "better" defaults when inserting yadif, change the actual "yadif" defaults. I pondered not changing vf_yadif, and instead adding a trivial "yadif- auto" wrapper filter, which would merely have different defaults. But thinking about it, it doesn't make any sense for "deinterlace" to have different defaults from vf_yadif, with vf_yadif having the "worse" defaults. If someone wants the old behavior, the old behavior can be forced in a backward and forward compatible way by setting the suboptions. Fixes #2539 (kind of).
* ao_wasapi: move volume control init to it's own functionKevin Mitchell2015-12-211-21/+34
| | | | also make failure non-fatal
* ao_wasapi: correctly handle audio session display failureKevin Mitchell2015-12-211-10/+14
| | | | | In particular, try and release/null the interface so that it won't be marshalled.
* ao_wasapi: non-fatal error handling for COM marshallingKevin Mitchell2015-12-213-55/+65
| | | | | Also make sure that CoReleaseMarshalData is called if errors occur before unmarshalling.
* ao_wasapi: wrap long lines and use only c99 comment styleKevin Mitchell2015-12-214-119/+172
| | | | | also remove a log message in AOCONTROL_UPDATE_STREAM_TITLE since none of the other controls have one.
* ao_wasapi: reorganize private structureKevin Mitchell2015-12-211-37/+36
|
* ao_wasapi: remove useless buffer_block_sizeKevin Mitchell2015-12-212-7/+0
| | | | this was only ever used for a verbose message
* ao_wasapi: move exclusive and shared-specific controls to functionsKevin Mitchell2015-12-211-75/+87
|
* charset_conv: check for UTF-8 if uchardet returns unknownwm42015-12-201-0/+2
| | | | | | | | When libuchardet returns an empty string, it can be either ASCII, UTF-8, or an unknown encoding. Try to distinguish it from the unknown case by checking for UTF-8. This avoids an annoying message, and avoids unnecessary processing (we convert invalid UTF-8 sequences to latin1 to workaround libavcodec's braindead UTF-8 check).
* demux_disc: fix aspect ratio retrieval (again)wm42015-12-201-3/+3
| | | | | | Commit 127da161 was not properly tested either - it did nothing, and just made it use the video bitstream aspect ratio determined by libavformat (which isn't always the correct one).
* vo_opengl: x11: fix alpha windowswm42015-12-201-2/+3
| | | | | | | long is 64 bits on x86_64 on Linux, which means the check for the corner case of computing the depth mask is wrong. Also, X11 compositors seem to expect premultiplied alpha.
* ao_wasapi: call the class-specific release functionsKevin Mitchell2015-12-201-6/+6
| | | | | IUnknown_Release() might be alright, but stay on the safe side.
* ao_wasapi: check for proxy availability in controlKevin Mitchell2015-12-201-22/+37
| | | | | Make sure that the proxy has been created before using it. This will be used when a future commit makes proxy setup optional.
* ao_wasapi: actually use hw volume support information for exclusive modeKevin Mitchell2015-12-202-17/+30
| | | | | | | | | Do not try and set/get master volume in exclusive if there is no hardware support. This would just uselessly change the master slider, but have no effect on the actual volume. Furthermore if getting hardware volume support information fails, then assume it has none.
* ao_wasapi: don't cast control arg to something it isn'tKevin Mitchell2015-12-201-9/+14
| | | | | the ao_control_vol_t cast was happening outside AOCONTROL_GET/SET_VOLUME which is the only place that would be valid
* ao_wasapi: remove volume "restore" on exitKevin Mitchell2015-12-203-48/+10
| | | | | | It was complicated and not even very intuitive to the user. If you are controlling the master volume, you just have to be prepared to deal with the consequences.
* ao_wasapi: split exclusive/shared specific ao controlsKevin Mitchell2015-12-201-37/+60