summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* m_option: redo code for parsing -vf to accept quoteswm42013-04-211-130/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Parsing sub-configs (like --rawvideo=subopts or the suboptions for --vo=opengl:subopts) was completely different from the -vf parsing code for a variety of reasons. This change at least makes -vf use the same splitter code as sub-config options. The main improvement is that -vf now accepts quotes, so you can write things like: -vf 'lavfi=graph="gradfun=10:20"' (The '' quotes are for shell escaping.) This is a rather big and intrusive change. Trying some -vf lines from etc/encoding-example-profiles.conf seems to confirm it still works. This also attempts to unify one subtle difference in handling of positional arguments. One consequence is that a minor detail changes. Sub-configs don't know positional arguments, and something like "-- opt=sub1=val1:sub2" means that sub2 has to be a flag option. In -vf parsing, sub2 would be a positional option value. To remove this conflict and to facilitate actual unification of the parsers in the future, the sub2 will be considered a flag option if and only if such a flag option exists. Otherwise, it's considered a value for a positional option. E.g. if there's a filter "foo" with a string option "sopt" and a flag option "fopt", the behavior of the following changes: -vf foo=fopt Before this commit, this would set "sopt=fopt" in the filter. Now, it enables the fopt flag, and the sopt option remains unset. This is not an actual problem to my knowledge.
* m_option: add function to check whether parameters are requiredwm42013-04-213-4/+11
| | | | To avoid that it will be duplicated with m_option.c and m_config.c.
* options: untangle track range parsing for stream_cddawm42013-04-213-89/+15
| | | | | | | | | Remove the "object settings" based track range parsing (needed by stream_cdda only), and make stream_cdda use CONF_TYPE_INT_PAIR. This makes the -vf parsing code completely independent from other options. A bit of that code was used by the mechanism removed with this commit.
* m_option: split out sub-config parsingwm42013-04-211-37/+54
|
* bstr: add bstrto0()wm42013-04-211-0/+6
|
* bstr: add bstrspn()wm42013-04-212-0/+10
|
* x11_common: minor simplificationwm42013-04-211-13/+6
|
* demux_lavf: fix subtitle seeking before start of the filewm42013-04-211-2/+7
| | | | | | | | | | | | | | | | | | When trying to seek before the start of the file, which usually happens when using the arrow keys to seek to the start of the file, external libavformat demuxed subtitles will be invisible. This is because seeking in the external subtitle file fails, so the subtitle demuxer is left in a random state. This is actually similar to the normal seeking path, which has some fallback code to handle this situation. Add such code to the subtitle seeking path too. (Normally, all demuxer support av_seek_frame(), except subtitles, which support avformat_seek_file() only. The latter was meant to be the "new" seeking API, but this never really took off, and using it normally seems to cause worse seeking behavior. Or maybe we just use it incorrectly, nobody really knows.)
* mplayer: prefer -sub/-subfile subs over auto-loaded subswm42013-04-202-2/+9
| | | | | | | | | Before this commit, it was more or less random which subtitle was preferred if there was both an auto-loaded external subtitle, and a subtitle loaded via -sub or -subfile. -sub subtitles happened to be preferred over auto-loaded subs, while -subfile didn't. Fix the -subfile case, and make the behavior consistent by making the selection behavior explicit.
* demux_mkv: always set track->codec_id to a stringwm42013-04-201-1/+3
| | | | | Otherwise audio/video/sub track handling code would dereference the NULL pointer.
* subassconvert: add more web colorswm42013-04-201-24/+153
| | | | | | | | Now includes the complete list from [1] at this time. Switch from BGR to RGB to match with that list. [1] http://www.w3.org/TR/css3-color/#svg-color
* core: display subtitle codec in track listingwm42013-04-203-4/+13
| | | | | Also switch the subrip and subviewer names, which obviously have been confused.
* demux_mkv: always add subtitle trackswm42013-04-201-26/+26
| | | | Even if the codec is unknown.
* demux: remove some unused sh_video_t fieldswm42013-04-204-15/+1
| | | | Completely mysterious, and its values were never actually used.
* demux: get rid of sh_common_twm42013-04-202-21/+14
| | | | | | The only reason this existed was the parsing code. Even though it could have been used for video, it's audio-only, so just move this to sh_audio_t.
* sub, demux: identify subtitle types with the codec namewm42013-04-2012-92/+91
| | | | | | | | | Get rid of the 1-char subtitle type field. Use sh_stream->codec instead just like audio and video do. Use codec names as defined by libavcodec for simplicity, even if they're somewhat verbose and annoying. Note that ffmpeg might switch to "ass" as codec name for ASS, so we don't bother with the current silly "ssa" name.
* av_common: allow calling mp_codec_to_av_codec_id() with NULLwm42013-04-201-7/+9
| | | | Helps reducing special cases.
* demux: remove useless vid/aid/sid fieldswm42013-04-203-7/+1
| | | | | Only demux_ts.c used sid in one case, replace that by reading the same value from another location.
* demux: fix clearing of input paddingwm42013-04-201-2/+2
| | | | | | MP_INPUT_BUFFER_PADDING_SIZE and FF_INPUT_BUFFER_PADDING_SIZE are both 16. The doxygen for FF_INPUT_BUFFER_PADDING_SIZE says only the first 23 bits must to be 0, but this is probably a lie.
* demux_mkv: introduce new_demux_packet_from() and use itwm42013-04-203-10/+15
|
* demux: remove some unused thingswm42013-04-203-47/+4
|
* command: try to switch subs too for program propertywm42013-04-201-2/+4
| | | | Untested, but why not.
* demux_lavf: simplifywm42013-04-201-147/+74
| | | | | | | | | | | | | | This removes the stream handling mess by using a single list for all stream types. One consequence is that new streams are always set to AVDISCARD_ALL, which could be an issue if packets are read before initializing other streams. However, this doesn't seem to an issue for various reasons, so we don't do anything about it. The new code strictly assumes that libavformat never removes or reorders streams once added to AVFormatContext->streams. Undefined behavior will result if it does.
* demux_mkv: simplify use of demuxer APIwm42013-04-201-106/+62
| | | | | | | mkv_track_t now references sh_stream directly, instead of using an ID. Also remove all accesses to demux_stream (demuxer->video etc.). Remove some slave-mode things on the way, like "ID_SID_..." messages.
* demux: add functions to simplify demuxerswm42013-04-203-7/+47
| | | | | | | | | | | | | | Some preparations to simplify demux_mkv and demux_lavf. struct demux_stream manages state for each stream type that is being demuxed (audio/video/sub). demux_stream is rather annoying, especially the id and sh members, which are often used by the demuxers to determine current stream and so on. Demuxers don't really have to access this, except for testing whether a stream is selected and to add packets. Add a new_sh_stream(), which allows creating streams without having the caller specify any kind of stream ID. Demuxers should just use sh_stream pointers, instead of multiple kinds of IDs and indexes.
* demux_mkv: code cleanupeng2013-04-201-20/+23
| | | | | | Cleanup based on results from cppcheck-1.59 Reduce the scope of several variables Replace 2 calloc/realloc calls with a single malloc
* demux_mkv: use new way of track switchingwm42013-04-201-45/+0
| | | | | | Since demux_mkv queries the demuxer state when reading packets, track switching is completely passive. Cycling etc. is done by the frontend. As result, all track switching code can be removed.
* demux: simpler way to notify demuxers about track switcheswm42013-04-202-2/+11
| | | | This interfaces assumes track switching is always successful.
* demux_mkv: remove pointless video track selectionwm42013-04-201-37/+0
| | | | Possibly once needed, now it's just redundant code.
* matroska: update dead linkwm42013-04-201-1/+1
|
* demux_mkv: support vp9wm42013-04-203-0/+3
| | | | Note that ffmpeg doesn't provide a decoder by default yet.
* core: matroska: support concatenated segmentswm42013-04-203-53/+133
| | | | | | | | | | | | | | | | | | | | | Matroska files can contain multiple segments, which are literally further Matroska files appended to the main file. They can be referenced by segment linking. While this is an extraordinarily useless and dumb feature, we support it for the hell of it. This is implemented by adding a further demuxer parameter for skipping segments. When scanning for linked segments, each file is opened multiple times, until there are no further segments found. Each segment will have a separate demuxer instance (with a separate file handle etc.). It appears the Matroska spec. has an even worse feature for segments: live streaming can completely reconfigure the stream by starting a new segment. We won't add support for it, because there are 0 people on this earth who think Matroska life streaming is a good idea. (As opposed to serving Matroska/WebM files via HTTP.)
* demux_mkv: don't terminate if there are no clusterswm42013-04-201-2/+3
| | | | | | Matroska segment linking allows abusing Matroska files as playlists without any actual video/audio/sub data, making files without any clusters still useful for the frontend.
* mplayer: take tracks from first segment if main file is emptywm42013-04-201-3/+9
| | | | | | | | | | | With Matroska ordered chapters, the main file (i.e. the file you're playing) can be empty, while all video/audio data is in linked files. Some files don't even contain the track list, only chapter information. mpv refused to play these, because normally, the main file dictates the track layout. Fix this by using the first segment for track data if no part of the timeline is sourced from the main file.
* demux_mkv: simplify handle_block() logic a bitwm42013-04-201-11/+8
|
* demux_mkv: verify laces separately, and in all caseswm42013-04-201-4/+10
|
* demux_mkv: get rid of the duplicated lace case labelswm42013-04-201-9/+4
| | | | | Also change the extracting of the lace type bitfield from flags to make it more apparent that the value range is 0-3.
* demux_mkv: there can be 256 laceswm42013-04-201-6/+5
| | | | | The lace number is stored with an offset of 1, so the maximum number of laces is 255+1=256.
* demux_mkv: check block malloc() resultwm42013-04-201-0/+2
|
* demux_mkv: use a bounded buffer for block datawm42013-04-203-120/+122
| | | | Should help avoiding out-of-bounds reads.
* demux_mkv: static allocation for lace sizes bufferwm42013-04-201-12/+8
| | | | | | | | Avoid messy memory management and error handling. remove tmp_lace_buffer non-sense Not sure how my mind got 8k, or how this made sense at all.
* demux_mkv: remove redundant checkwm42013-04-201-39/+37
|
* demux_mkv: fix seeking with index generationwm42013-04-201-45/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | Relative seeks backwards didn't work too well with incomplete files, or other files that are missing the seek index. The problem was that the on-the-fly seek index generation simply added cluster positions as seek entries. While this is perfectly fine, the seek code had no information about the location of video key frames. For example, a 5 second long cluster can have only 1 video key frame, which is located 4 seconds into the cluster. Seeking backwards by one second while still located in the same cluster would select this cluster as seek target again. Decoding would resume with the key frame, giving the impression that seeking is "stuck" at this frame. Make the generated index aware of key frame and track information, so that video can always be seeked in an idea way. This also uses the normal block parsing code for indexing the clusters, instead of the suspicious looking special code. (This code didn't parse the Matroska elements correctly, but was fine for files with normal structure. Files with corrupted clusters or clusters formatted for streaming were not handled properly.) Skipping is now quite a bit slower (takes about twice as long as before), but it removes the special cased skipping code, and it's still much faster (at least twice as fast) than libavformat. It needs to do more I/O (no more skipping entire clusters, all data is read), and has more CPU usage (more data needs to be parsed).
* demux_mkv: move Block header parsing codewm42013-04-201-34/+43
| | | | | | Move parts of the Block element parsing to read_block(). This way read_block() can return block time and track information in struct block_info.
* demux_mkv: split reading blocks and reading packetswm42013-04-201-37/+47
| | | | | | Move most code from demux_mkv_fill_buffer() to read_next_block(). The former is supposed to read raw blocks, while ..fill_buffer() reads blocks and turns them into packets.
* demux_mkv: move BlockGroup reading code to a separate functionwm42013-04-201-49/+61
| | | | | | | | | | Somehow this was setup such that a BlockGroup can be incrementally read (at least in theory). This makes no sense, as BlockGroup can contain only one Block (despite its name). There's no need to read this incrementally, and makes the code confusing for no gain. Read all the BlockGroup sub-elements with a single function call, without keeping global state for BlockGroup parsing.
* demux_mkv: factor block readingwm42013-04-201-55/+61
| | | | | | | | | | The code for reading block data was duplicated. Move it into a function. Instead of returning on error (possibly due to corrupt data) and signalling EOF, continue by trying to find the next block. This makes error handling slightly simpler too, because you don't have to care about freeing the current block. We could still signal EOF in this case, but trying to resync sounds better for dealing with corrupted files.
* demux_mkv: fix streaming clusterswm42013-04-201-1/+9
| | | | | | Matroska files prepared for streaming have clusters with unknown size. These files are pretty rare, see e.g. test4.mkv from the official Matroska test file collection.
* demux_mkv: simplify cluster reading codewm42013-04-201-32/+24
| | | | | | | | | | | | | The end positions of the current cluster and block were managed by tracking their size and how much of them were read, instead of just using the absolute end positions. I'm not sure about the reasons why this code was originally written this way. One obvious concern is reading from pipes and such, but the stream layers hides this. stream_tell(s) works even when reading from pipes. It's also a fast call, and doesn't involve the stream implementation or syscalls. Keeping track of the cluster/block end is simpler and there's no reason why this wouldn't work.
* demux_mkv: use normal index data structure even for incomplete fileswm42013-04-201-84/+63
| | | | | | | | | | | | Incomplete files don't have a valid index, because the index is usually located near the end of a file. In this case, an index is created on the fly during demuxing, or when seeks are done. This used a completely different code path, which leads to unnecessary complications and code duplication. Use the normal index data structure instead. The seeking code at the end of seek_creating_index() (in this commit renamed to create_index_until()) is removed. The normal seek code does the same thing instead.
* manpage: clarify --cache behaviorwm42013-04-201-0/+6
|
* Merge pull request #62 from maletor/patch-1wm42013-04-181-1/+1
|\ | | | | Fix typo for opengl dither-depth default
| * Fix typo for opengl dither-depth defaultEllis Berner2013-04-181-1/+1
|/
* cocoa_common: keep aspect ratio when clipping windowStefano Pigozzi2013-04-171-7/+35
| | | | | With commit 33ffc283 resizing to double size would cause the window to lose aspect ratio. This commit fixes this bug.
* change reverse DNS strings to io.mpv.*Stefano Pigozzi2013-04-162-2/+2
| | | | fixes #60
* cocoa_common: refactor centered resizeStefano Pigozzi2013-04-161-24/+21
| | | | | | This refactor makes the code easier to understand. Also corrects a bug that caused the window to move to the left when the new size was bigger than the visible frame.
* encoding: when output is pipe: or pipe:1, avoid mp_msg to stdoutRudolf Polzer2013-04-153-1/+11
| | | | | | | | | I am aware this detection may occur too late, depending on other settings, but at least it usually works and is portable. Where the output fd can be changed, though, it'd be better to force a similar behaviour via file descriptor use: use pipe:3 as output to FD 3, and change the calling program to expect the stream on FD 3.
* sub: add --osd-blur and --sub-text-blur optionswm42013-04-134-0/+8
| | | | | | | | | These require bleeding edge libass (latest git version), and will be ignored otherwise. I'm not sure about the blur factor and scaling. The ASS/VSFilter semantics for blur scaling are a bad mess. Might require further investigation.
* audio/decode: remove vararg from ad_control()wm42013-04-125-5/+5
| | | | | This was unused and dumb. Ancient MPlayer used varargs instead of void* arguments for control() functions, and this was the last leftover.
* osd_libass: actually free ASS_Trackswm42013-04-121-0/+6
| | | | Not a real leak, just for getting clean valgrind reports on exit.
* demux: simplify chapter appending codewm42013-04-121-14/+8
| | | | | This pre-allocation looked tricky and awkward. Use MP_TARRAY_APPEND(), which makes the code simpler. This even keeps the pre-allocation.
* demux: always sort chapterswm42013-04-122-8/+7
| | | | | | | | | | | The condition that checked whether the chapters are out of order and should be sorted was inverted. This likely wasn't noticed in testing, because even if the chapters are unsorted, if the last two chapters were sorted, the rest got sorted too. Instead of doing this silly check, always sort the chapters after demuxer initialization. Also make sure the sort order is stable in case chapter start times are the same (original_index check).
* core: remove dead --vsync leftoverswm42013-04-123-12/+1
|
* command: fix deref before NULL checkwm42013-04-121-1/+1
| | | | Was accidentally broken in the last global variable removal round.
* ao_jack: fix deprecation warningStefano Pigozzi2013-04-121-2/+5
| | | | | jack_port_get_total_latency is deprecated: use the "new" API based on jack_port_get_latency_range instead.
* mplayer: remove unnecessary variablewm42013-04-102-8/+4
|
* core: add --reset-on-next-file optionwm42013-04-106-0/+56
| | | | | | | This option can be used to selectively reset settings when playing the next file in the playlist (i.e. restore mplayer and mplayer2 behavior). Might remove this option again should it turn out that nobody uses it.
* mplayer: keep volume persistent, even when using --volumewm42013-04-103-4/+19
|