summaryrefslogtreecommitdiffstats
path: root/core
Commit message (Collapse)AuthorAgeFilesLines
* Cleanup some include statementswm42013-07-121-1/+0
|
* demux: rewrite probing and demuxer initializationwm42013-07-124-7/+4
| | | | | | | | | | | | | | Get rid of the strange and messy reliance on DEMUXER_TYPE_ constants. Instead of having two open functions for the demuxer callbacks (which somehow are both optional, but you can also decide to implement both...), just have one function. This function takes a parameter that tells the demuxer how strictly it should check for the file headers. This is a nice simplification and allows more flexibility. Remove the file extension code. This literally did nothing (anymore). Change demux_lavf so that we check our other builtin demuxers first before libavformat tries to guess by file extension.
* mplayer: minor memory leak in error handling codewm42013-07-121-0/+1
|
* core: change open_stream and demux_open signaturewm42013-07-128-60/+17
| | | | | | | | | | | This removes the dependency on DEMUXER_TYPE_* and the file_format parameter from the stream open functions. Remove some of the playlist handling code. It looks like this was needed only for loading linked mov files with demux_mov (which was removed long ago). Delete a minor bit of dead network-related code from stream.c as well.
* core: completely change handling of attached picture pseudo videowm42013-07-112-16/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, we tried to play along with libavformat and tried to pretend that attached pictures are video streams with a single frame, and that the frame magically appeared at the seek position when seeking. The playback core would then switch to a mode where the video has ended, and the "remaining" audio is played. This didn't work very well: - we needed a hack in demux.c, because we tried to read more packets in order to find the "next" video frame (libavformat doesn't tell us if a stream has ended) - switching the video stream didn't work, because we can't tell libavformat to send the packet again - seeking and resuming after was hacky (for some reason libavformat sets the returned packet's PTS to that of the previously returned audio packet in generic code not related to attached pictures, and this happened to work) - if the user did something stupid and e.g. inserted a deinterlacer by default, a picture was never displayed, only an inactive VO window) - same when using a command that reconfigured the VO (like switching aspect or video filters) - hr-seek didn't work For this reason, handle attached pictures as separate case with a separate video decoding function, which doesn't read packets. Also, do not synchronize audio to video start in this case.
* demux: improve DVD sub auto-selection hackwm42013-07-111-18/+8
| | | | | | | | | | | | | | | | | | | | | | | The code touched by this commit makes sure that DVD subtitle tracks known by libdvdread but not known by demux_lavf can be selected and displayed properly. These subtitle tracks have the first packet some time late in the packet stream, so that libavformat won't immediately recognize them, and will add the track as soon as the first packet is seen during normal demuxing. demux_mpg used to handle this elegantly: you just set the MPEG ID of the stream you wanted. demux_lavf couldn't do this, so it was emulated with a DEMUXER_CTRL. This commit changes it so that new streams are selected by default (if autoselect is enabled), and the playloop simply can take appropriate action before the lower layer throws away the first packet. This also changes the demux_lavf behavior that subtitle packets are always demuxed, even if not needed. (They were immediately thrown away, so there was no advantage to this.) Further, this adds the ability to demux.c to deal with demuxing more than one stream of a kind at once. (Though currently it's not useful.)
* video: eliminate frametime variablewm42013-07-111-13/+9
|
* core: don't access demux_stream outside of demux.c, make it privatewm42013-07-112-21/+21
| | | | | | | | | | | | | | | | | | | Generally remove all accesses to demux_stream from all the code, except inside of demux.c. Make it completely private to demux.c. This simplifies the code because it removes an extra concept. In demux.c it is reduced to a simple packet queue. There were other uses of demux_stream, but they were removed or are removed with this commit. Remove the extra "ds" argument to demux fill_buffer callback. It was used by demux_avi and the TV pseudo-demuxer only. Remove usage of d_video->last_pts from the no-correct-pts code. This field contains the last PTS retrieved after a packet that is not NOPTS. We can easily get this value manually because we read the packets ourselves. Reuse sh_video->last_pts to store the packet PTS values. It was used only by the correct-pts code before, and like d_video->last_pts, it is reset on seek. The behavior should be exactly the same.
* mplayer: invert negated boolean variablewm42013-07-111-10/+10
| | | | | Boolean variables shouldn't carry a negated meaning, so rename non_interleaved to interleaved.
* mplayer: fix incorrect audio sync after format changeswm42013-07-111-2/+6
| | | | | | | | | | | This is not directly related to the handling of format changes itself, but playing audio normally after the change. This was broken: the output byte rate was not recalculated, so audio-video sync was simply broken. Fix this by calculating the byte rate on the fly, instead of storing it in sh_audio. Format changes are relatively common (switches between stereo and 5.1 in TV recordings), so this fixes a somewhat critical bug.
* mplayer: remove "old" audio PTS calculation codewm42013-07-111-27/+9
| | | | | | | | Removing this code doesn't change anything. All remaining audio decoders are well-behaved enough to not overwrite sh_audio->pts if they don't know the PTS. And if they don't know the PTS, the d_audio->last_pts field can't contain any usable value either, because both fields contain theame value: the last known valid PTS found in an audio packet.
* mplayer: don't set bogus video pts after seek resetwm42013-07-111-5/+2
| | | | | | As the comment n the removed code says, this was once needed for something subtitle related. This code has been cleaned up long ago, so at least the original reason for it is gone.
* demux: remove facility for partial packet readswm42013-07-111-56/+30
| | | | | | | | | | | | | | | | | | Partial packet reads were needed because the video/audio parsers were working on top of them. So it could happen that a parser read a part of a packet, and returned that to the decoder. With libavformat/libavcodec, packets are already parsed, and everything is much simpler. Most of the simplifications in ad_spdif could have been done earlier. Remove some other stuff as well, like the questionable slave mode start time reporting (could be replaced by proper code, but we don't bother). Remove the unused skip_audio_frame() functionality as well (it was used by old demuxers). Some functions become private to demux.c, like demux_fill_buffer(). Introduce new packet read functions, which have simpler semantics. Packets returned from them are owned by the caller, and all packets in the demux.c packet queue are considered unread. Remove special code that dropped subtitle packets with size 0. This used to be needed because it caused special cases in the old code.
* core: remove demux_mpg subtitle PTS hackwm42013-07-101-23/+4
| | | | | | | | | This code used to be part of the demux_mpg and vobsub specific code path. Then (just recently) the different code paths for subtitles were merged, so this code became active even for demux_lavf and demux_mkv. As far as I can tell, this code won't help much, and at least sd_lavc (which will be used for DVD subs and other potentially weird things) can deal with NOPTS values.
* core: simplify some no-correct-pts codewm42013-07-101-33/+13
| | | | | | | | | | | | | | Remove the special handling for mng/mkv. These don't profit at all from no-correct-pts mode, and even removing the mkv specific code makes mkv work better (wow!). Don't check for (int)fps == 1000. I don't know where this value comes from. Maybe it was once a special value which triggered certain behavior, but the code for that must have gone away. The only way to trigger this value would be by coincidence if two frames are 1 ms apart. Otherwise, the behavior should be exactly the same, except for some removed messages.
* core: move code from demux/video.c to mplayer.cwm42013-07-101-0/+63
| | | | | Although I don't like putting even more crap into mplayer.c, this is a bit better, especially with coming cleanups in mind.
* audio: remove decoder input bufferwm42013-07-101-4/+2
| | | | This was unused.
* options: remove --ignore-startwm42013-07-083-13/+0
| | | | This was used only with demux_avi.
* Merge branch 'master' into remove_old_demuxerswm42013-07-087-33/+179
|\ | | | | | | | | | | Conflicts: DOCS/man/en/changes.rst DOCS/man/en/options.rst
| * command: add screenshot_to_file commandwm42013-07-087-28/+103
| |
| * input: actually copy sub commandswm42013-07-081-0/+12
| | | | | | | | | | | | | | | | | | This was missing from the previous commit. It worked by luck, because the sub-commands weren't freed either (as long as the original command was around), but this is proper. Also, set the original string for command lists (needed for input-test only).
| * input: allow binding multiple commands to a keywm42013-07-083-5/+64
| | | | | | | | Separate the commands with ';'.
* | demux: simplify demux_open() callswm42013-07-084-25/+4
| | | | | | | | | | | | The demux_open as well as demux_open_withparams calls don't use the stream selection parameters anymore, so remove them everywhere. Completes the previous commit.
* | demux: remove separate arrays for audio/video/sub streams, simplifywm42013-07-082-13/+10
| | | | | | | | | | | | | | | | | | | | | | | | These separate arrays were used by the old demuxers and are not needed anymore. We can simplify track switching as well. One interesting thing is that stream/tv.c (which is a demuxer) won't respect --no-audio anymore. It will probably work as expected, but it will still open an audio device etc. - this is because track selection is now always done with the runtime track switching mechanism. Maybe the TV code could be updated to do proper runtime switching, but I can't test this stuff.
* | demux: remove video_read_propertieswm42013-07-081-18/+13
| |
* | Remove old demuxerswm42013-07-072-8/+6
|/ | | | | | | | | | Delete demux_avi, demux_asf, demux_mpg, demux_ts. libavformat does better than them (except in rare corner cases), and the demuxers have a bad influence on the rest of the code. Often they don't output proper packets, and require additional audio and video parsing. Most work only in --no-correct-pts mode. Remove them to facilitate further cleanups.
* Remove internal network supportwm42013-07-073-15/+33
| | | | | | | | | | | This commit removes the "old" networking code in favor of libavformat's code. The code was still used for mp_http, udp, ftp, cddb. http has been mapped to libavformat's http support since approximately 6 months ago. udp and ftp have support in ffmpeg (though ftp was added only last month). cddb support is removed with this commit - it's probably not important and rarely used if at all, so we don't care about it.
* core: make network options available even if old net code is disabledwm42013-07-072-2/+18
| | | | Preparation for removing the old network code.
* playlist: don't add entries in reversewm42013-07-051-0/+1
| | | | | | | | The entries were always added after the insertion point - but that means the entries are appended in reverse order. So update the insertion point on each entry. Regression introduced by commit 5f664d7.
* core: remove mp_fifo leftoverswm42013-07-041-40/+0
|
* cocoa: remove usage of mp_fifoStefano Pigozzi2013-07-031-1/+0
| | | | | | Update Cocoa parts to remove usage of the mp_fifo internal API to send events to the core and use the input context directly. This is to follow commits the work in commits 70a8079c and d603e73c.
* core: cleanup more mp_fifo leftoverswm42013-07-023-3/+0
| | | | Now only the OSX and Wayland parts are using this.
* core: remove mp_fifo indirectionwm42013-07-029-106/+73
| | | | | | | | | | For some reason mp_fifo specifically handled double clicks, and other than that was a pointless wrapper around input.c functionality. Move the double click handling into input.c, and get rid of mp_fifo. Add some compatibility wrappers, because so much VO code uses these functions. Where struct mp_fifo is still used it's just a casted struct input_ctx.
* command: add some playlist manipulation commandswm42013-07-025-0/+44
| | | | playlist_remove and playlist_move.
* core: update metadata during playback, allow streams to export metadatawm42013-07-022-0/+6
| | | | | | | STREAM_CTRL_GET_METADATA will be used to poll for streamcast metadata. Also add DEMUXER_CTRL_UPDATE_INFO, which could in theory be used by demux_lavf.c. (Unfortunately, libavformat is too crappy to read metadata mid-stream for mp3 or ogg, so we don't implement it.)
* input: require VOs to send key up events, redo input key lookupwm42013-07-024-76/+80
| | | | | | | | | | | | | | Making key up events implicit was sort-of a nice idea, but it's too tricky and unreliable and makes the key lookup code (interpret_keys()) hard to reason about. See e.g. previous commit for subtle bugs and issues this caused. Make key-up events explicit instead. Add key up events to all VOs. Any time MP_KEY_STATE_DOWN is used, the matching key up event must use MP_KEY_STATE_UP. Rewrite the key lookup code. It should be simpler and more robust now. (Even though the LOC increases, because the new code is less "compact".)
* input: fix behavior if there are actually key up eventswm42013-07-021-1/+2
| | | | | | | | | Wayland is the only backend that actually sends per-key key up events (the X11 one just sends MP_INPUT_RELEASE_ALL for simplicity). Handling was broken with Wayland, and each key event was interpreted twice, once on key down and once on key up. This commit should fix it.
* input: don't ignore press-only mouse button eventswm42013-06-301-1/+2
| | | | | | | | Before this commit, only mouse events with both down and up events were processed. This caused a regression with ignoring mouse wheel events in cocoa, because these don't distinguish between up and down. Regression caused by 5b38a52.
* dec_sub: introduce sub_control(), use it for sub_stepwm42013-06-291-8/+7
| | | | | | | This means the direct libass usage can be removed from command.c, and no weird hacks for retrieving the ASS_Track are needed. Also fix a bug when using this feature with ordered chapters.
* command: redraw subs if sub-delay is changedwm42013-06-291-1/+1
| | | | | Though in practice this probably happened anyway, because OSD was redrawn.
* sub: update subtitle time offset even if pausedwm42013-06-291-5/+5
| | | | | | This was changed as part of commit b44202b as an intended simplification, but it's actually nicer to have the subtitles update immediately even if paused.
* input: store number of binds, instead of using 0-terminationwm42013-06-291-60/+54
|
* input: store number of keys, instead of using 0-terminationwm42013-06-291-21/+24
|
* input: don't keep separate sections for builtin key bindingswm42013-06-291-62/+76
| | | | | | | | | | Instead mark individual key bindings as builtin. Not sure whether this is conceptually simpler or more complicated. For one, it requires the annoying remove_binds() function to wipe existing bindings instead of just killing the section, on the other hand it gets rid of almost all special handling of builtin vs. normal sections.
* mplayer: don't hide mouse cursor if mouse is inside mouse areawm42013-06-292-1/+5
|
* input: trigger mouse_leave key bindings if mouse leaves mouse areawm42013-06-293-12/+52
| | | | | | Also, implement mouse leave events for X11. But evne on other platforms, these events will be generated if mouse crosses a section's mouse area boundaries within the mpv window.
* command: add commands to enable/disable input sectionswm42013-06-293-0/+19
| | | | | For now, it's mostly for testing. It also might allow to create key binding state machines, but this sounds questionable.
* input: handle mouse movement differentlywm42013-06-296-145/+328
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, mouse movement events emitted a special command ("set_mouse_pos"), which was specially handled in command.c. This was once special-cased to the dvdnav and menu code, and did nothing after libmenu and dvdnav were removed. Change it so that mouse movement triggers a pseudo-key ("MOUSE_MOVE"), which then can be bound to an arbitrary command. The mouse position is now managed in input.c. A command which actually needs the mouse position can use either mp_input_get_mouse_pos() or mp_get_osd_mouse_pos() to query it. The former returns raw window-space coordinates, while the latter returns coordinates transformed to OSD- space. (Both are the same for most VOs, except vo_xv and vo_x11, which can't render OSD in window-space. These require extra code for mapping mouse position.) As of this commit, there is still nothing that uses mouse movement, so MOUSE_MOVE is mapped to "ignore" to silence warnings when moving the mouse (much like MOUSE_BTN0). Extend the concept of input sections. Allow multiple sections to be active at once, and organize them as stack. Bindings from the top of the stack are preferred to lower ones. Each section has a mouse input section associated, inside which mouse events are associated with the bindings. If the mouse pointer is outside of a section's mouse area, mouse events will be dispatched to an input section lower on the stack of active sections. This is intended for scripting, which is to be added later. Two scripts could occupy different areas of the screen without conflicting with each other. (If it turns out that this mechanism is useless, we'll just remove it again.)
* command: make raw percent-pos property return fractionswm42013-06-291-3/+6
| | | | | | | | | percent-pos was an integer (0-100). Sometimes higher precision is wanted, but the property is this way because fractional parts would look silly with normal OSD usage. As a compromise, make percent-pos double (i.e. includes fractional parts), but print it as integer. So ${percent-pos} is like an integer, but not ${=percent-pos}.
* command: add properties for playlist positionwm42013-06-295-9/+102
| | | | | playlist-pos can set/get the current playlist index. playlist-count returns the number of entries in the playlist.
* core: add libquvi 0.9 supportwm42013-06-285-9/+286
| | | | | | | | | | | | | This adds support for libquvi 0.9.x, and these features: - start time (part of youtube URL) - youtube subtitles - alternative source switching ('l' and 'L' keys) - youtube playlists Note that libquvi 0.9 is still in development. Although this seems to be API stable now, it looks like there will be a 1.0 release, which is supposed to be the next stable release and the actual successor of libquvi 0.4.x.
* core: rename mplayer.h and quvi.cwm42013-06-284-10/+6
| | | | | | mplayer.h used to be used for much more stuff, but all what is left are quvi related definitions. Rename quvi.c as well to make its purpose clearer.
* options: rename --mkv-subtitle-preroll, --dtshdwm42013-06-281-2/+6
| | | | We still keep the old names as alias for short-time compatibility.
* options: rename --rawvideo to --demuxer-rawvideo, same with --rawaudiowm42013-06-281-3/+2
|
* options: rename -lavdopts to -vd-lavc, -lavfdopts to -demuxer-lavfwm42013-06-281-3/+4
| | | | | Also change manpage so that top-level options are documented instead of suboptions. Suboptions still work, but might go away eventually.
* options: remove -lavdopts debug suboptionwm42013-06-281-1/+0
| | | | This can be set as avopt instead.
* Merge branch 'sub_mess2'wm42013-06-259-92/+325
|\ | | | | | | ...the return.
| * options: add -sub-speed optionwm42013-06-252-0/+3
| | | | | | | | | | | | | | | | Should we actually get into trouble for unproper handling of frame-based subtitle formats, this might be the simplest way to work this around. Also is a bit more intuitive than -subfps, which might use an unknown, misdetected, or non-sense video FPS. Still pretty silly, though.
| * sub: libguess support for -subcpwm42013-06-251-1/+27
| | | | | | | | Actually this is rather disappointing.
| * sub: add subtitle charset conversionwm42013-06-252<