summaryrefslogtreecommitdiffstats
path: root/demux
Commit message (Collapse)AuthorAgeFilesLines
* 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 level.
* demux_mkv: always fail on header reading errorwm42014-01-221-6/+2
| | | | | | | | | | | For some reason, if an error happened when reading headers, it merely stopped reading the headers, and then continued normally. (It looks like the case to exit hard (-2) was mainly used for skipping unwanted ordered chapter segments.) I can't comprehend this. Always exit on error when reading headers. (Maybe some more error tolerance would be good, but I have no test case, and there's some danger of entering endless loops.)
* demux_mkv: avoid seeking when reading headerswm42014-01-221-128/+116
| | | | | | | | | This makes everything more robust, and also somewhat simpler (even if the diffstat isn't very impressive). Instead of recursively following SeekHeads while reading headers, just read the headers until the first cluster, and then possibly use SeekHeads to read the remaining missing headers.
* 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.
* ebml: remove length parameters from read functionswm42014-01-143-39/+27
| | | | | | | Many ebml_read_* functions have a length int pointer parameter, which returns the number of bytes skipped. Nothing actually needed this (anymore), and code using it was rather hard to understand, so get rid of them.
* ebml: remove unused functionswm42014-01-142-90/+0
| | | | These were mostly replaced by ebml_read_element().
* demux_mkv: remove unused macroswm42014-01-141-3/+0
|
* demux_mkv: improve robustness by explicitly checking for level 1 elementswm42014-01-143-46/+50
| | | | | | | | | | | | | | | | | | | | Matroska makes it pretty hard to resync correctly on broken files: random data returns "valid" EBML IDs with a high probability, and when trying to skip them it's likely that you skip a random amount of data (instead of considering the element length invalid). Improve upon this by skipping known level 1 elements only. Consider everything else invalid and call the resync code. This might result in annoying behavior when Matroska adds new level 1 elements, although it won't be particularly harmful. Matroska doesn't really allow us to do better (even mkvtoolnix explicitly checks for known level 1 elements). Since we now don't always want to combine EBML element skipping and resyncing, remove ebml_read_skip_or_resync_cluster(), and make ebml_read_skip() more tolerant against skipping broken elements. Also, don't resync when reading sub-elements, and instead do resyncing when reading them results in an error.
* demux_mkv: avoid skipping too much data in corrupted fileswm42014-01-143-14/+18
| | | | | | | | | | Until now, corrupted files were detected if the size of an element (that should be skipped) was larger than the remaining file. This still could skip larger regions of the file itself if the broken size happened to be within the file. Change it so that it's never allowed to skip outside the parent's element.
* demux_lavf: add hack for MicroDVD for assuming frame based timingwm42014-01-101-0/+6
| | | | | | | | | | | MicroDVD files _can_ contain real timestamps instead of frame timestamps if they declare a FPS. But this seems to be rare, so ignore that if the FPS happens to match with the libavformat microdvd parser's default FPS. This might actually break files that declare 23.976 FPS, but the video file is not 23.976 FPS, but the chance that this happens is probably very low, and the commit fixes the more common breakage with 25 FPS video.
* demux_lavf: fix minor memory leakwm42014-01-071-1/+1
|
* demux_subreader: reject file if not opened by --subwm42014-01-042-0/+4
| | | | | | | demux_subreader.c contains the old MPlayer subtitle parser, and I have absolutely no confidence in this (very crappy) code. There might be one or two security risks associated with running that code on arbitrary input.
* demux_mkv: handle TrueHD properlywm42013-12-271-32/+98
| | | | | | | | | Apparently, Matroska packs TrueHD packets in a way lavc doesn't expect. This broke decoding of some files [1] completely. A short look at the libavcodec parser shows that parsing this ourselves would probably be too much work, so make use of the libavcodec parser API. [1] http://www.cccp-project.net/beta/test_files/mzero_truehd_sample.mkv
* subreader: replace some strcpy callswm42013-12-221-2/+3
|
* subreader: remove overlapping strcpywm42013-12-221-1/+2
| | | | Looks like this relied on undefined behavior.
* demux: don't prefix tag output with demuxer namewm42013-12-212-9/+12
| | | | Add a separate mp_log instance for this purpose.
* msg: convert defines to enumwm42013-12-211-1/+1
| | | | Also get rid of MSGL_HINT and the many MSGL_DBG* levels.
* charset_conv: mp_msg conversionswm42013-12-211-2/+3
|
* stream: mp_msg conversionswm42013-12-211-1/+1
| | | | We also drop some slave mode stuff from stream_vcd.
* demux: mp_msg conversionswm42013-12-2112-342/+316
| | | | | | | The TV code pretends to be part of stream/, but it's actually demuxer code too. The audio_in code is shared between the TV code and stream_radio.c, so stream_radio.c needs a small hack until stream.c is converted.
* demux: use fprintf() for printing fatal errorswm42013-12-211-6/+4
| | | | | We print these before calling abort(), which is deadly unclean anyway. Avoids having to add log contexts.
* Split mpvcore/ into common/, misc/, bstr/wm42013-12-1714-24/+24
|
* Merge mp_talloc.h into ta/ta_talloc.hwm42013-12-172-2/+0
|
* Move options/config related files from mpvcore/ to options/wm42013-12-178-10/+10
| | | | | | | | | 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.
* Replace mp_tmsg, mp_dbg -> mp_msg, remove mp_gtext(), remove set_osd_tmsgwm42013-12-163-24/+24
| | | | | | | | | The tmsg stuff was for the internal gettext() based translation system, which nobody ever attempted to use and thus was removed. mp_gtext() and set_osd_tmsg() were also for this. mp_dbg was once enabled in debug mode only, but since we have log level for enabling debug messages, it seems utterly useless.
* demux_mkv: don't seek outside of the file when finding segmentswm42013-12-141-1/+4
| | | | | | | | The end of the current segment will be the end of the file if there is no next segment. Normally, this didn't matter much, since UNIX files allow seeking past the end of the file. But when opening files from HTTP, this would print confusing error messages. So explicitly check for EOF before trying to read a segment.
* stream: add function for dropping the bufferwm42013-12-141-0/+1
| | | | | And use it in demux_lavf.c. It looks like otherwise, some data might be left over, depending on how the hell av_seek_frame() behaves.
* demux_lavf: fix timebase confusionwm42013-12-121-7/+7
| | | | | This set last_pts to bogus values, which is used for relative seeks. The player usually uses absolute seeks, so this didn't matter much.
* demux: revert accidentally included change from previous commitwm42013-12-121-1/+1
| | | | Oops.
* Add prelimimary (basic, possibly broken) dvdnav supportwm42013-12-121-1/+3
| | | | | | | | | | | |