summaryrefslogtreecommitdiffstats
path: root/demux
Commit message (Collapse)AuthorAgeFilesLines
* Add more constwm42014-06-113-9/+9
| | | | | | | 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_raw: remove global option variableswm42014-06-111-51/+78
|
* demux_mf: remove global option variableswm42014-06-112-9/+6
|
* command: redo ancient TV/DVB/PVR commandswm42014-06-111-0/+7
| | | | | | | | | | | | | | | | | | Convert all these commands to properties. (Except tv_last_channel, not sure what to do with this.) Also, internally, don't access stream details directly, but dispatch commands with stream ctrls. Many of the new properties are a bit strange, because they're write- only. Also remove some OSD output these commands produced, because I couldn't be bothered to port these. In general, this makes everything much cleaner, and will also make it easier to e.g. move the demuxer to its own thread. Don't bother updating input.conf, but changes.rst documents how old commands map to the new ones. Mostly untested, due to lack of hardware.
* demux_lavf: support new rotation metadata APIwm42014-06-011-1/+11
|
* command: improve video-bitrate propertyAndrey Morozov2014-06-011-0/+3
| | | | | | Signed-off-by: wm4 <wm4@nowhere> Includes some cosmetic changes over the original PR.
* player: hide audio/video codec and file format messageswm42014-05-311-3/+3
| | | | | None of these are very important usually. For error analysis, the plain log is useless anyway, and this information is still printed with "-v".
* af_fmt2bits: change to af_fmt2bps (bytes/sample) where appropriateMarcoen Hirschberg2014-05-281-1/+1
| | | | | | In most places where af_fmt2bits is called to get the bits/sample, the result is immediately converted to bytes/sample. Avoid this by getting bytes/sample directly by introducing af_fmt2bps.
* audio: rename i_bps to 'bitrate' to avoid confusionMarcoen Hirschberg2014-05-283-5/+5
| | | | Since i_bps now contains bits/sec, rename it to reflect this change.
* audio: change values from bytes-per-second to bits-per-secondMarcoen Hirschberg2014-05-283-5/+5
| | | | | | | The i_bps members of the sh_audio and dev_video structs are mostly used for displaying the average audio and video bitrates. Keeping them in bits-per-second avoids truncating them to bytes-per-second and changing them back lateron.
* stream: don't use end_poswm42014-05-244-22/+32
| | | | | | | | | | | | | | | | | | | Stop using it in most places, and prefer STREAM_CTRL_GET_SIZE. The advantage is that always the correct size will be used. There can be no doubt anymore whether the end_pos value is outdated (as it happens often with files that are being downloaded). Some streams still use end_pos. They don't change size, and it's easier to emulate STREAM_CTRL_GET_SIZE using end_pos, instead of adding a STREAM_CTRL_GET_SIZE implementation to these streams. Make sure int64_t is always used for STREAM_CTRL_GET_SIZE (it was uint64_t before). Remove the seek flags mess, and replace them with a seekable flag. Every stream must set it consistently now, and an assertion in stream.c checks this. Don't distinguish between streams that can only be forward or backwards seeked, since we have no such stream types.
* stream: kill start_pos, remove --sb optionwm42014-05-243-11/+10
| | | | | | | | | | | | | | | | | | | | stream.start_pos was needed for optical media only, and (apparently) not for very good reasons. Just get rid of it. For stream_dvd, we don't need to do anything. Byte seeking was already removed from it earlier. For stream_cdda and stream_vcd, emulate the start_pos by offsetting the stream pos as seen by the rest of mpv. The bits in discnav.c and loadfile.c were for dealing with the code seeking back to the start in demux.c. Handle this differently by assuming the demuxer is always initialized with the stream at start position, and instead seek back if initializing the demuxer fails. Remove the --sb option, which worked by modifying stream.start_pos. If someone really wants this option, it could be added back by creating a "slice" stream (actually ffmpeg already has such a thing).
* demux_subreader: remove support for some subtitle formatswm42014-05-191-629/+4
| | | | | | | | | | | | | | | | Drop: sami, vplayer, rt, pjs, mpsub, aqt, jacosub. None of these seem to be actually in use, except sami. Sami is very complex, and the results subreader produces are not very useful. For all these formats, there are still parsers in FFmpeg. We remove the subreader implementation, because it might contain security relevant bugs and such. (This is old, unmaintained C string parsing code, written in times where absolutely nobody cared about security. The kind of awesome code.) We keep the other formats, because they're (mostly) commonly used and relatively simple, for UTF16 support (still missing in FFmpeg), and for the sake of Libav.
* 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_lavf: one more hack for mp3 from networkwm42014-05-041-1/+1
| | | | | | | | | | | | | | mp3 has a hack lowering the probescore for format detection. This is because detecting mp3s is hard due to their nature, and the fact that ID3v2 tags are sometimes several megabytes big. When playing mp3 from network, the mime-type is usually set, and that matches the format hack entry meant for webradios, overriding the normal mp3 entry. This can lead to network mp3s not being detected. Lower the network case to the same probescore as on-disk mp3s. The difference is that for network mp3s, we don't load the full probe-buffer, and we lower the amount of audio the demuxer will read to collect data on opening (0.5 seconds instead of typically 5 seconds).
* options: remove deprecated --identifyMartin Herkt2014-05-041-5/+0
| | | | | | | Also remove MSGL_SMODE and friends. Note: The indent in options.rst was added to work around a bug in ReportLab that causes the PDF manual build to fail.
* demux_mkv: enable parsing for VP9wm42014-04-261-2/+4
| | | | | | | | | | | | VP9 packets can contain 2 frames in some video packets (from which 1 frame is invisible). Due to a design mismatch between libvpx and the libavcodec vp9 decoder, libvpx can take the "full" packets, but lavc vp9 can not. The consequence is that we have to split the packets if we want to feed them to the lavc codec. This is not entirely correct yet: timestamp handling is missing. --demuxer=lavf and ffmpeg native utilities have the same problem. We can fix this only once the ffmpeg VP9 parser is fixed.
* demux_mkv: enable parsing for mp3wm42014-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | For some reason, some files appear to have broken mp3 packets, or at least in a form that libavcodec can't deal with. The audio in the sample file in question could not be decoded using libavcodec. The problematic file had variable packet sizes, and the libavcodec decoder kept printing "mp3: Header missing" for each packet it was fed. Remuxing with mkvmerge fixes the problem. The mp3 data is probably not VBR, and remuxing resulted in fixed-size mp3 frames. So I don't know why the sample file was muxed this way - it might just be incorrect. The sample file had "libmkv 0.6.4" as MuxingApp (although I could not get mkvinfo to print this element, maybe the file uses an incorrect element ID), and "HandBrake 0.9.4" as WritingApp. Note that the libmpg123 decoder does not have any issues with it. It's probably more robust, because libmpg123 was made to decode whole mp3 files, not just single frames. Fixes issue #742.
* build: glob() is always availablewm42014-04-221-6/+0
| | | | | | | | | glob() is mandated by POSIX. For the only non-POSIX platform we support, Windows, we have our own replacement. So the ifdeffery is not needed. Still leave the checks in the configure scripts, because they have to decide whether to compile the replacement or not. (Although this could be special cased to mingw-only, the wscript seems to make this hard.)
* glob-win: support UnicodeJames Ross-Gowan2014-04-211-9/+1
| | | | | | | | | | | | | | | | glob-win.c wasn't big, so it was easier to rewrite it. The new version supports Unicode, handles directories properly, sorts the output and puts all its allocations in the same talloc context to simplify the implementation of globfree. Notably, the old glob had error checking code, but didn't do anything with the errors since the error reporting code was commented out. The new glob doesn't copy this behaviour. It just treats errors as if there were no more matching files, which shouldn't matter for mpv, since it ignores glob errors too. To match the other Windows I/O helper functions, the definition is moved to osdep/io.h.
* demux: export video rotation parameterwm42014-04-212-0/+9
| | | | | Now the rotation hint is propagated everywhere. It just isn't used anywhere yet.
* Kill all tabswm42014-04-131-572/+572
| | | | | | | | | | | I hate tabs. This replaces all tabs in all source files with spaces. The only exception is old-makefile. The replacement was made by running the GNU coreutils "expand" command on every file. Since the replacement was automatic, it's possible that some formatting was destroyed (but perhaps only if it was assuming that the end of a tab does not correspond to aligning the end to multiples of 8 spaces).
* mp_tags: move generic mp_tags stuff into its own .c/.h files in common/Kevin Mitchell2014-04-133-65/+6
| | | | | | rename add_metadata to the more genera/descriptive mp_tags_copy_items_from_av_dictionary Signed-off-by: wm4 <wm4@nowhere>
* stream_dvd, cache: hack seeking with --cache + dvd:// back into workingwm42014-04-091-0/+2
| | | | | | | | | | | | | | | | | | | This was broken at some unknown point (even before the recent cache changes). There are several problems: - stream_dvd returning a random stream position, confusing the cache layer (cached data and stream data lost their 1:1 corrospondence by position) - this also confused the mechanism added with commit a9671524, which basically triggered random seeking (although this was not the only problem) - demux_lavf requesting seeks in the stream layer, which resulted in seeks in the cache or the real stream Fix this by completely removing byte-based seeking from stream_dvd. This already works fine for stream_dvdnav and stream_bluray. Now all these streams do time-based seeks, and pretend to be infinite streams of data, and the rest of the player simply doesn't care about the stream byte positions.
* demux: add "BIKb" FourCCVika Apelsinova2014-04-081-0/+1
| | | | | | More support for the worst codec ever. Signed-off-by: wm4 <wm4@nowhere>
* demux: move metadata-based replaygain decoding out of af_volumeAlessandro Ghedini2014-04-041-0/+78
|
* demux: add replaygain_data field to demuxer_tAlessandro Ghedini2014-04-042-1/+47
|
* player: remove demuxer chapoter API wrapperswm42014-03-252-75/+5
| | | | | | Instead, always use the mpctx->chapters array. Before this commit, this array was used only for ordered chapters and such, but now it's always populated if there are chapters.
* stream: remove old chapter handling codewm42014-03-251-33/+10
| | | | | | | | Stream-level chapters (like DVD etc.) did potentially not have timestamps for each chapter, so STREAM_CTRL_SEEK_TO_CHAPTER and STREAM_CTRL_GET_CURRENT_CHAPTER were needed to navigate chapters. We've switched everything to use timestamps and that seems to work, so we can simplify the code and remove this old mechanism.
* demux: use av_packet_ref()wm42014-03-161-4/+1
| | | | | av_copy_packet() was FFmpeg specific, av_packet_ref() is now available on all supported libavcodec releases.
* Remove some more unneeded version checkswm42014-03-161-15/+0
| | | | | All of these check against things that happened before the latest supported FFmpeg/Libav release.
* demux_libass: change how external ASS subtitles are loadedwm42014-03-153-35/+20
| | | | | | | | | | Instead of parsing the ASS file in demux_libass.c and trying to pass the ASS_Track to the subtitle renderer, just read all file data in demux_libass.c, and let the subtitle renderer pass the file contents to ass_process_codec_private(). (This happens to parse full files too.) Makes the code simpler, though it also relies harder on the (messy) probe logic in demux_libass.c.
* demux_lavf: fix typo in commentwm42014-03-041-1/+1
| | | | Pushed too early...
* sub: use new FFmpeg API to check MicroDVD FPSwm42014-03-043-7/+16
| | | | | | Before this, it wasn't possible to distinguish MicroDVD subtitles without FPS header, and subtitles with FPS header equal to FFmpeg's fallback FPS.
* client API: add event for metadata changeswm42014-02-192-2/+4
|
* demux: expose stream_type_name() functionwm42014-02-162-1/+3
|
* sub: handle vobsub-in-mp4wm42014-02-132-0/+3
| | | | | | | | | | | The mplayer decoder (spudec.c) actually handled this. There was explicit code for binary palettes (16 32 bit values), and the subtitle resolution was handled by video resolution coincidentally matching the subtitle resolution. Whoever puts vobsub into mp4 should be punished. Fixes the sample gundam_sample.mp4, closes github issue #547.
* demux_mkv: remove weird seeking semantics for audiowm42014-02-091-6/+1
| | | | | | | | | | | | This skipped all audio packets before the first video key frame was found. I'm not really sure why this would be needed; most likely it isn't. So get rid of it. Even if audio packets are returned to the player too soon, the player will sync the audio start to the video start by decoding and discarding audio data. Note that although the removed code was just added in the previous commit, it merely kept the old keeping semantics which demux_mkv always followed. This commit removes these special semantics.
* demux_mkv: improve audio-only seekingwm42014-02-091-5/+8
| | | | | | | | | | | | | | | | v_skip_to_keyframe is set to true while non-keyframe video packets are skipped. Until now, audio packets were also skipped when doing this. I can't see any good reason why this would be done, but for now I want to keep the old logic when audio+video seeks are done. However, for audio-only mode, do proper seeking, which also fixes behavior when trying to seek past the end of the file: playback is terminated properly, instead of starting playback on the start of the last cluster. Note that a_no_timecode_check is used only for audio+video seek. I'm not sure what this is needed for, but it might influence A/V sync after seeking.
* demux: fix some newlines in output messageswm42014-02-091-2/+2
|
* demux_lavf: work around idiotic libavutil API printing a warningwm42014-02-081-1/+5
| | | | | | | | | | Trying to set a non-existent flag (like +keepside on Libav) causes libavutil print an incomprehensible warning (something about eval; probably the overengineered libavutil option parser tripping over the '+' normally used for flags, and trying to interpret it as formula). There's apparently no easy way to check for the existence of a flag, so add some more ifdeffery to shut it up.
* demux_lavf: do metadata-from-packet update before possibly discarding itwm42014-02-061-2/+1
| | | | | | | | | | | | There is some logic to discard packets from streams that are not selected. Run the metadata update code before this, just to make 100% sure that no metadata updates can be lost when streams are deselected. (I'm not sure why this logic would be needed, since both libavformat and the generic demuxer code do this already. But a quick test shows that av_read_frame() can return a packet from a stream even if the stream has AVStream.discard set to AVDISCARD_ALL. This happened after stream switching. Maybe libavformat doesn't discard already queued packets.)
* demux_lavf: don't check for error when setting "keepside" flagwm42014-02-061-4/+1
| | | | | This flag doesn't exist on Libav (because they never do this insane packet merging stuff), so this would print unnecessary warnings there.
* demux: reword "Clip info:" line to "File tags:"wm42014-02-061-1/+1
|
* demux: fill metadata directly, instead of using wrapper functionswm42014-02-064-57/+26
| | | | | | Get rid of demux_info_add[_bstr] and demuxer_add_chapter_info. Make demuxer_add_chapter_info return the chapter index for convenience.
* demux_lavf: clear metadata on update, instead of merging itwm42014-02-063-0/+8
| | | | | Assume a metadata update is a full update. Clear the previous metadata, so that tags which existed only in the previous metadata are removed.
* demux: handle tag updates differentlywm42014-02-062-14/+20
| | | | | | | | | | | | | | | | Instead of printing lines like: Demuxer info GENRE changed to Alternative Rock Just output all tags once they change. The assumption is that individual tags rarely change, while all tags change in the common case. This changes tag updates to use polling. This could be fixed later, although the ICY stuff makes it a bit painful, so maybe it will remain this way. Also remove DEMUXER_CTRL_UPDATE_INFO. This was intended to check for tag updates, but now we use a different approach.
* demux_lavf: get updated metadata from a packet if availableBen Boeckel2014-02-061-0/+25
| | | | The side_data type is brand new in ffmpeg.
* mf: don't limit filename length with PATH_MAXwm42014-02-031-3/+3
| | | | | | | | Use an arbitrary constant instead, which is as good as PATH_MAX. This helps us to avoid having to think about pull request #523. Also fix a case where a potentially signed char was passed to isspace().
* demux_mkv: remove unused fieldwm42014-01-311-4/+0
|
* demux_lavf: fix crash with empty fileswm42014-01-311-1/+1
| | | | | | | | | | This used to work; I'm not sure when or why it regressed. When setting AVProbeData.filename to NULL, libavformat will crash in rtp_probe() by unconditionally accessing the string. We used to set the filename to NULL to prevent probing by file extension when we don't deem it as necessary. Using an empty string also works for this purpose.
* demux_lavf: add hack to workaround too unreliable mp3 detectionwm42014-01-251-0/+2
| | | | | | | | | | | This generally affects mp3 files that don't have any (or many) mp3 frames in the first 2 MB. 2 MB is the maximum probe size, and libavformat returns a low probescore even if we give it the full 2 MB. Trying to probe a larger buffer (or even the full file) doesn't work for mysterious reasons. The workaround consists in accepting a very weak probescore if the format is detected as mp3 and we probed already 2 MB.
* demux_lavf: refactor format probing hackwm42014-01-251-26/+24
| | | | | | Restructure it a bit, so we can use the format hack list even if no mime type applies. Shouldn't change anything functionally yet. Preparation for the next commit.
* demux_mkv: nicer edition outputwm42014-01-232-10/+52
| | | | | | | | | | | If there's more than one edition, print the list of editions, including the edition name, whether the edition is selected, whether the edition is default, and the command line option to select the edition. (Similar to stream list.) Move reading the tags to a separate function process_tags(), which is called when all other state is parsed. Otherwise, that tags will be lost if chapters are read after the tags.
* demux_mkv: don't attempt to seek back when indexingwm42014-01-221-8/+0
| | | | | | | | | | | | Pretty worthless. This is called from the seek code, which will reinitialize these anyway. Even if seeking somehow decides to fail, the new values are still valid. One could say a failed seek (if that happens) should jump back to the original position, and thus it would be better to make sure the state is restored. But then demux_mkv_seek needs to do this correctly, including not setting up skipping to the target timestamp. But not bothering with this.
* demux_mkv: fix EOF with concatenated segmentswm42014-01-221-7/+14
| | | | | | | | | Extremely obscure corner case with concatenated segments, in which EOF wasn't recognized correctly, and it tried to demux clusters from the next segment. See [MKV]_Editions,_Linked_Segments,_&_Tracksets.mkv from the CCCP test file collection.
* demux_mkv: remove old track printing codewm42014-01-221-12/+0
| | | | | | This basically used to be part of the user interface, before mpv moved printing the track list to the frontend, and this code was raised to verbose output leve