summaryrefslogtreecommitdiffstats
path: root/demux/demux_playlist.c
Commit message (Collapse)AuthorAgeFilesLines
* stream: get rid of streamtype enumwm42017-02-021-1/+1
| | | | | | | | | Because it's kind of dumb. (But not sure if it was worth the trouble.) For stream_file.c, we add new explicit fields. The rest are rather special uses and can be killed by comparing the stream impl. name. The changes to DVD/BD/CD/TV are entirely untested.
* demux, stream: add option to prevent opening referenced fileswm42016-12-041-0/+5
| | | | Quite irresponsibly hacked together. Sue me.
* demux_playlist: recognize m3u8 as playlist extensionwm42016-05-171-2/+9
| | | | Whatever. As mentioned in #3154.
* demux_playlist: read directories recursivewm42016-04-181-17/+57
| | | | | | | | | | | | | | demux_playlist.c recognizes if the source stream points to a directory, and adds its directory entries. Until now, only 1 level was added. During playback, further directory entries could be resolved as directory paths were "played". While this worked fine, it lead to frequent user confusion, because playlist resuming and other things didn't work as expected. So just recursively scan everything. I'm unsure whether it's a good fix, but at least it gets rid of the complaints. (And probably will add others.)
* Relicense some non-MPlayer source files to LGPL 2.1 or laterwm42016-01-191-25/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This covers source files which were added in mplayer2 and mpv times only, and where all code is covered by LGPL relicensing agreements. There are probably more files to which this applies, but I'm being conservative here. A file named ao_sdl.c exists in MPlayer too, but the mpv one is a complete rewrite, and was added some time after the original ao_sdl.c was removed. The same applies to vo_sdl.c, for which the SDL2 API is radically different in addition (MPlayer supports SDL 1.2 only). common.c contains only code written by me. But common.h is a strange case: although it originally was named mp_common.h and exists in MPlayer too, by now it contains only definitions written by uau and me. The exceptions are the CONTROL_ defines - thus not changing the license of common.h yet. codec_tags.c contained once large tables generated from MPlayer's codecs.conf, but all of these tables were removed. From demux_playlist.c I'm removing a code fragment from someone who was not asked; this probably could be done later (see commit 15dccc37). misc.c is a bit complicated to reason about (it was split off mplayer.c and thus contains random functions out of this file), but actually all functions have been added post-MPlayer. Except get_relative_time(), which was written by uau, but looks similar to 3 different versions of something similar in each of the Unix/win32/OSX timer source files. I'm not sure what that means in regards to copyright, so I've just moved it into another still-GPL source file for now. screenshot.c once had some minor parts of MPlayer's vf_screenshot.c, but they're all gone.
* player: warn against using HLS URLs with --playlistwm42015-08-041-1/+4
| | | | | | | | | That just makes no sense, but seems to be a somewhat common user error. The detection is not perfect. It's conceivable that EXT-X-... headers are used in normal m3u playlists. After all, HLS playlists are by definition a compatible extension to m3u playlists, as stupid as it sounds.
* demux_playlist: skip hidden directorieswm42015-07-291-1/+1
| | | | | | | | The user probably doesn't want these. Conveniently, this also skips the unwanted "." and ".." entries. (This code is triggered if the input stream is a directory - and it's in demux_playlist.c because it's convenient.)
* player: parse and expose m3u playlist titleswm42015-07-101-2/+16
| | | | Requested. Closes #2100.
* demux_playlist: make mime type comparison case-insensitivewm42015-06-201-1/+1
| | | | | | | | That's how mime types are. (This makes redirection with a specific HLS URL work, because some idiot thought it'd be a great idea to spell the mime type as "application/x-mpegURL".)
* path: make mp_path_join accept normal C stringswm42015-05-091-1/+1
| | | | | Instead of bstr. Most callers of this function do not need bstr. The bstr version of this function is now mp_path_join_bstr().
* player: allow playing directorieswm42015-04-171-1/+53
| | | | | | | | | | | If a directory is encountered, replace it with its contents in the internal playlist. This is messed into demux_playlist.c, because why not. STREAMTYPE_DIR could be avoided by unconditonally trying opendir() in demux_playlist.c, but it seems nicer not to do weird things like calling it on real files. This does not work on Windows, because msvcrt is retarded.
* demux: fix rar support for files containing DTS audio trackswm42015-03-241-26/+0
| | | | | | | | | | | | | | | | | With a recent cleanup, rar support was stuffed into demux_playlist.c (because "opening" rar files pretty much just lists archive contents and adds them to a playlist using a special rar:// protocol, which will actually access the rar file contents). Since demux_playlist.c is probed _after_ demux_lavf.c (and should/must be), libavformat was given the chance to detect DTS streams embedded within the rar file. This is not really what we want, and a regression what happened before rar listing was moved to demux_playlist.c. Fix it by moving the rar listing into its own pseudo-demuxer, and let ir probe before demux_lavf.c. (Yes, this feature still has users.)
* player: refine rar:// playlist-safety handlingwm42015-03-021-0/+1
| | | | | | | | | | | | It was possible to make the player play local files by putting rar:// links into remote playlists, and some other potentially unsafe things. Redo the handling of it. Now the rar-redirector (the thing in demux_playlist.c) sets disable_safety, which makes the player open any playlist entries returned. This is fine, because it redirects to the same file anyway (just with different selection/interpretation of the contents). On the other hand, rar:// itself is now considered fully unsafe, which means that it is ignored if found in normal playlists.
* stream_rar: treat rar files as playlistswm42015-02-271-0/+25
| | | | | | | | | | | | Refactors an older hack, which for some reason used a more complicated way. This generates the playlist representing the contents of the rar file in demux_playlist.c. The pseudo-demuxer could easily be separate from the the playlist parsers (and in fact there's almost no shared code), but I don't think this obscure feature deserves a separate file. Sample files created with: rar a -v20000k -m0 files.rar file1.mkv file1.mkv
* player: enable cache and demuxer thread for subtitles toowm42015-02-181-0/+1
| | | | | | | | | Includes some logic for not starting the demuxer thread for fully read subtitles. (Well, the cache will still waste _lots_ of resources, and the cache always has to be created, because we don't know whether it'll be needed _before_ opening the file.) See #1597.
* demux_playlist: unquote entries in pls playlistswm42014-12-301-0/+3
| | | | I guess these parsers still have a way to go...
* demux_playlist: fix negated conditionwm42014-12-061-1/+1
| | | | Fuck.
* demux_playlist: detect headerless m3u files by extensionwm42014-12-051-1/+24
| | | | | | | | | | | | | | | m3u files are normally just text files with a list of filenames. Nothing actually mandates that there is a header. Until now, we've rejected such files, because there's absolutely no way to detect them. If nothing else claims the file, the extension is ".m3u", and if the contents of the file look like text, then load it as m3u playlist. The text heuristic is pretty cheap, but at least it should prevent trying to load binary data as playlist. (Which would "work", but result in a catastrophic user experience.) Due to the text heuristic, UTF-16/32 files will be rejected (unless they have a header), but I don't care.
* demux_playlist: don't ignore last line in m3uwm42014-11-301-2/+2
| | | | | | | | If EOF is reached after reading a line, the EOF flag is set. This was a problem for the m3u code, which checked for EOF _after_ reading a line, which will discard the last line read. Also fix a typo in an unrelated part of the file.
* demux_playlist: redirect ASF streaming to mmsh://wm42014-10-301-14/+30
| | | | | | | | | | | | I'm not sure if this could be done in libavformat instead. Probably not, because libavformat doesn't seem to have any mechanism for trying one protocol and reverting (or redirecting) to another one if needed. This commit is sort of a hack too, because it redirects the URL by pretending the http:// link is a playlist containing the mmsh:// link. The list of mime types is borrowed from MPlayer (which has completely different code to handle this).
* build: include <strings.h> for strcasecmp()wm42014-07-101-0/+2
| | | | | | | It happens to work without strings.h on glibc or with _GNU_SOURCE, but the POSIX standard requires including <strings.h>. Hopefully fixes OSX build.
* Add more constwm42014-06-111-3/+3
| | | | | | | While I'm not very fond of "const", it's important for declarations (it decides whether a symbol is emitted in a read-only or read/write section). Fix all these cases, so we have writeable global data only when we really need.
* demux_playlist: fix m3u detection logicwm42014-05-111-1/+1
| | | | | | | | | Caused failure to detect .pls files, because they were misdetected as m3u. The problem is that "forcing playlist files" and "forcing a specific playlist format" are not really treated separate, and in both cases p->force is set to true. This made m3u detect all files as m3u if --playlist was used. So correctly check whether the file format is actually being probed or not.
* demux_playlist: don't require header for m3uwm42014-05-061-4/+3
| | | | | | | | | Because the http playlist URL I had for testing claimed to be m3u by file extension and mime type, but didn't have the header. Note that this actually changes behavior only in the case the format is detected by mime type. Then p->force will be set before calling the parser, and the header becomes optional.
* demux_playlist: add some mime typeswm42014-05-061-2/+4
|
* demux_playlist: allow recognizing format by mime typewm42014-05-061-0/+21
| | | | | This commit just adds basic support. The following commit will add actual mime types.
* demux_playlist: move parser for plaintext playlistswm42014-01-191-2/+23
| | | | | This was implemented in playlist_parser.c. To make it use the improved implementation of stream_read_line(), move it to demux_playlist.c.
* demux_playlist: handle stream_read_line() errorswm42014-01-191-2/+6
| | | | | | | | | As of this commit, stream_read_line() can't actually error (except in the case the passed in buffer is 0, which never happens here). This commit is preparation for the following commit, which checks harder whether the read data is actually text. Before this commit, an error was treated as end-of-file, but the data read so far was considered valid.
* Split mpvcore/ into common/, misc/, bstr/wm42013-12-171-3/+3
|
* Move options/config related files from mpvcore/ to options/wm42013-12-171-2/+2
| | | | | | | | | Since m_option.h and options.h are extremely often included, a lot of files have to be changed. Moving path.c/h to options/ is a bit questionable, but since this is mainly about access to config files (which are also handled in options/), it's probably ok.
* playlist: rewrite PLS parserwm42013-11-041-0/+22
| | | | | | | | | | | | Somehow the new parser ends up much smaller. Much of it is because we don't parse some additional information. We just skip it, instead of parsing it and then throwing it away. More importantly, we use the physical order of entries, instead of trying to sort them by entry number. Each "File" entry is followed by a number that is supposed to be the entry number, and "File1" is first. (Should it turn out that this is really needed, an additional field should be added to playlist_entry, and then qsort().)
* demux_playlist: add mov RTSPtext tag parserBenjamin Franzke2013-09-141-0/+18
| | | | | | | | | | | | | | | | | The quicktime html scripting guide suggests to wrap urls not necesarly associated with quicktime in a .mov file. (so that when <embed>ing videos quicktime would be forced.) These mov files may contain several "Text Hacks". One of these is RTSPtext. The suggested/allowed format (as regex) is like: RTSPtext[ \r]RTSP://url See also p.51 of: https://developer.apple.com/library/mac/documentation/QuickTime/Conceptual/QTScripting_HTML/QTScripting_HTML.pdf In reality there are also files like (e.g. zdfmediathek.de): RTSPtext\nrtsp://url\n\n Lets handle these files as a playlist with one element.
* demux_playlist: port ini reference playlist parserwm42013-08-281-1/+18
| | | | | | | | | | Port it from playlist_parser.c to demux_playlist.c. Also, change the m3u parser to drop whitespace from the trailing part of the line (will make it work properly with windows line endings). (I hoped that this would make MMS URIs with http instead of mmsh prefixes work, but it doesn't. Instead, it leads to a playlist loop. So solving this issue would require a change in ffmpeg, probably.)
* core: add a playlist demuxerwm42013-08-261-0/+136
Modeled after the old playlist_parser.c, but actually new code, and it works a bit differently. Demuxers (and sometimes streams) are the component that should be used to open files and to determine the file format. This was already done for subtitles, but playlists still use a separate code path.