summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* demux_mkv: never force output sample ratewm42013-07-163-30/+15
| | | | | | | | | | | | | | Matroska has an output sample rate (OutputSamplingFrequency), which in theory should be forced instead of whatever the decoder outputs. But it appears no software (other than mplayer2 and mpv until now) actually respects this. Even worse, there were broken files around, which played correctly with (in theory) broken software, but not mplayer2/mpv. Hacks were added to our code to play these files correctly, but they didn't catch all cases. Simplify this by doing what everyone else does, and always use the decoder's sample rate instead. In particular, we try to handle all sample rate issues like libavformat's Matroska demuxer does.
* wayland: early aspect calculation in vo_configAlexander Preisinger2013-07-163-7/+27
| | | | | | | | | | | | Calculate the aspect ratio in vo_config, when we get the window size and in the inside the resize function we calculate the aspect ratio of the output in order to determine if we have to change the height or the width of the video. If the ratio of the output is bigger than the ratio of the video then we have to set the width accordingly and if the ratio is smaller we change the size. But only if no resize edges are passed, because this indicates that we want to change the windows state instead of just a simple resize and the video should not grow bigger than the requested size.
* wayland: use default fullscreen methodAlexander Preisinger2013-07-161-1/+1
| | | | | I misunderstood how the different methods work and if we set the size accordingly to the wayland configure event then METHOD_DEFAULT is what we want.
* README: copy paragraph about --enable-* from configurewm42013-07-161-0/+12
| | | | | | | This issue hits users way too often. Copy the explanation printed by the configure script to the README to give it more visibility. We will fix this properly once we have a new build system.
* w32_common: don't use aspdat.asp for aspectwm42013-07-161-1/+2
| | | | | | | | aspdat.asp is a problem, because it's updated when the VO calls vo_get_src_dst_rects(). Nothing guarantees that the value has been updated when the w32 code accesses it. Instead, use the aspect vo_w32_config() was called with.
* mp_common: add MPMAX/MPMIN macroswm42013-07-151-0/+3
| | | | | | | | | | | From now on, usage of these macros is encouraged over using FFMAX and FFMIN. FFMAX and FFMIN are perfectly fine, and the added macros are actually exactly the same as the FFMAX and FFMIN definitions. But they require including libavutil headers, and certain differences between Libav and FFmpeg very often introduced breakages if these macros were somehow not defined because a header was not recursively included. Defining this macro on our own is the best way to escape from this annoying issue.
* README: small addition to encoding dependencieswm42013-07-151-2/+2
|
* configure: add /usr/local on FreeBSD, also NetBSD/DragonFlywm42013-07-151-0/+10
| | | | | | In my opinion this should be unneeded and unclean, which is why I removed it some time ago. But apparently this is a convenience for BSD users (so they don't have to use --extra-cflags), so add it back.
* stream: remove unused vcd functionswm42013-07-154-22/+0
| | | | Gets rid of warnings.
* demux_subreader: make clang happy to fix warningwm42013-07-151-1/+1
| | | | | Clang warns here, probably because it's easy to confuse with the usual ((a=b)) pattern.
* Fix build on Libav stable (dammit)wm42013-07-151-0/+8
| | | | | | | The previous commit fixed Libav git, but it was still broken on Libav 9.8. Also, while we're at it, add a note to lavc_dr1.c and its status.
* Fix build on Libav (again)wm42013-07-151-0/+1
| | | | | | .... This time actually tested with an actual Libav copy.
* Fix build on Libavwm42013-07-152-0/+2
| | | | Sigh, why does this happen all the time...
* sd_ass: scale blur by original video size if requestedwm42013-07-154-1/+22
|
* sd_add: add terrible hack for (xy-)vsfilter compatibilitywm42013-07-158-9/+177
| | | | | | Much has been said about this topic, we don't need to say even more. See additions to options.rst.
* vd: add VDCTRL_GET_PARAMSwm42013-07-152-0/+4
| | | | | | This is probably going to be unused, but might help with debugging and such. It returns the image parameters as determined by the video decoder.
* video: unify colorspace setupwm42013-07-154-24/+38
| | | | | | | | | | Guess the colorspace directly in mpcodecs_reconfig_vo(), instead of in set_video_colorspace(). The difference is that the latter function just makes the video filter chain (and VOs) force the detected colorspace, and then throws it away, while the former is a bit more general and central. Not really a big difference and it doesn't matter much in practice, but it guarantees that there is no internal disagreement about the colorspace.
* vf: add vf_control wrapperwm42013-07-153-6/+12
| | | | | Slightly cleaner, although rather redundant. But still, why wasn't this added 10 years ago?
* dec_video: add vd_control wrapperwm42013-07-152-7/+12
| | | | Slightly cleaner.
* mp_image: explicitly forbid using RGB colorspace with YUV formatswm42013-07-151-0/+9
| | | | This probably has more potential for breakage than it would be of use.
* mp_image: refactor colorspace guessing/fallbackwm42013-07-152-9/+46
| | | | This actually handles XYZ too.
* demux_lavf: add terrible hack to make DVD playback just workwm42013-07-143-8/+96
| | | | | | | | | | | | | | | | | | DVD playback had some trouble with PTS resets: libavformat's genpts feature would try reading until EOF (worst case) to find a new usable PTS in case a packet's PTS is not set correctly. Especially with slow DVD access, this would make the player to appear frozen. Reimplement it partially in demux_lavf.c, and use that code in the DVD case. This is heavily "inspired" by the code in av_read_frame from libavformat/utils.c. The difference is that we stop reading if no PTS has been found after 50 packets (consider this a heuristic). Also, we don't bother with the PTS wrapping and last-frame-before-EOF handling. Even with normal PTS wraps, the player frontend will go to hell for the duration of a frame anyway, and should recover quickly after that. The terribleness of this commit is mostly that we duplicate libavformat functionality, and that we suddenly need a packet queue.
* Merge branch 'remove_old_demuxers'wm42013-07-1484-13057/+1299
|\ | | | | | | | | | | | | | | The merged branch doesn't actually just remove old demuxers, but also includes a branch of cleanups and some refactoring. Conflicts: stream/stream.c
| * demux_raw: uncrustifywm42013-07-141-160/+162
| | | | | | | | Should have been done before doing all the changes...
| * tech-overview.txt: minor changes and additionswm42013-07-141-27/+38
| |
| * demux_mkv: remove weird i_bps calculation codewm42013-07-121-20/+0
| | | | | | | | Useless, as i_bps isn't really used for anything anymore.
| * mplayer: remove generic duration calculationwm42013-07-121-11/+1
| | | | | | | | | | | | | | | | | | | | | | This was useless for anything but the raw demuxers. In most cases, this would most likely lead to display of bogus duration values, because the bitrates used are per-track, not the total file bitrate. There was actually no case left where this code was helpful. Note that demux_lavf has its own code for this using the total file bitrate. Also, mplayer.c can calculate the playback percentage from current file position / current file size. This is not removed.
| * demux_raw: calculate durationwm42013-07-121-0/+23
| |
| * demux_rawvideo/demux_rawaudio: move both demuxers to demux_raw.cwm42013-07-123-151/+99
| | | | | | | | | | This allows them to share some trivial code. Both demuxers are still separate from user perspective.
| * demux: make claiming accurate seek the defaultwm42013-07-124-4/+4
| | | | | | | | Enables hr-seek for raw audio/video demuxers.
| * demux_rawvideo: fix timestamps in correct-pts modewm42013-07-121-1/+1
| |
| * demux: assume correct-pts mode by defaultwm42013-07-126-13/+4
| | | | | | | | | | | | | | | | All demuxers make a reasonable effort to set packet timestamps, and thus support correct-pts mode. This commit also implicitly switches demux_rawvideo to correct-pts mode. We still allow demuxers to disable correct-pts mode in theory.
| * demux: remove useless author/comment fieldswm42013-07-1213-60/+21
| | | | | | | | Same deal as with previous commit.
| * stream: remove useless author/comment fieldswm42013-07-1217-58/+19
| | | | | | | | | | | | | | | | | | These were printed only with -v. Most streams had them set to useless or redundant values, so it's just badly maintained bloat. Since we remove the "author" field too, and since this may have copyright implications, we add the contents of the author fields to the file headers, except if the name is already part of the file header.
| * stream: remove unused functionswm42013-07-121-36/+0
| | | | | | | | These were used by old demuxers.
| * stream: remove fd memberwm42013-07-128-66/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stream implementations could set this to a unix file descriptor. The generic stream code could use it as fallback for a few things. This was confusing and insane. In most cases, the stream implementations defined all callbacks, so setting the fd member didn't have any advantages, other than avoiding defining a private struct to store it. It appears that even if the stream implementation used close() on the fd (or something equivalent), stream.c would close() it a second time (and on windows, even would call closesocket()), which should be proof for the insanity of this code. For stream_file.c, additionally make sure we don't close stdin or stdout if "-" is used as filename. For stream_vcd.c, remove the control() code. This code most likely didn't make the slightest sense, because it used a different type for stream->priv. It also leaked memory. Maybe it worked, but it's incorrect and insignificant anyway, so kill it. This code was added with commit 9521c19 (svn commit 31019). Untested for all protocols other than stream_file.c.
| * stream: use talloc for some string memberswm42013-07-121-7/+7
| | | | | | | | Minor simplification.
| * stream: don't require streams to set a typewm42013-07-129-34/+13
| | | | | | | | | | Set the type only for streams that have special treatment in other parts of the code.
| * Cleanup some include statementswm42013-07-1214-22/+10
| |
| * demux: rewrite probing and demuxer initializationwm42013-07-1222-437/+223
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1229-158/+84
| | | | | | | | | | | | | | | | | | | | | | 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.
| * demux: change signature of open functions, cleanupswm42013-07-1113-177/+152
| | | | | | | | Preparation for redoing the open functions.
| * demux: allow passing NULL as packet to demuxer_add_packet()wm42013-07-111-1/+1
| | | | | | | | demux_subreader relied on this.
| * stheader: minor cleanupwm42013-07-113-6/+3
| | | | | | | | | | | | | | Move codec_tags.h include to demux_mkv.c, because this is the only file which still uses it. Move new_sh_stream() to demux.h, because this is more proper.
| * core: completely change handling of attached picture pseudo videowm42013-07-115-50/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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_lavf: do stream selection centrallywm42013-07-111-12/+13
| | | | | | | | Removes very minor code duplication for setting the st->discard flag.
| * demux: improve DVD sub auto-selection hackwm42013-07-114-42/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.)
| * demux_lavf: use AVDISCARD_DEFAULT instead of AVDISCARD_NONEwm42013-07-111-1/+1
| | | | | | | | | | | | AVDISCARD_DEFAULT is probably a bit better for normal decoding. AVDISCARD_NONE would (as by documentation) include "useless" packets too, while DEFAULT filters these.
| * video: eliminate frametime variablewm42013-07-118-21/+9
| |
| * ad_lavc: re-unsimplify, fix libavcodec API usagewm42013-07-111-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out that some code that was removed earlier was still needed. avcodec_decode_audio4() can decode packets "partially". In that case, you have to "slice" the packet and call the decode function again. Codecs which need this are obscure and in low numbers. One sample that needs it is here: rsync://fate-suite.ffmpeg.org/fate-suite/lossless-audio/luckynight-partial.shn (This one decodes in rather small increments.) The new code is much simpler than what has been removed earlier, though. The fact that we own the packet returned by the demuxer helps a lot. Not sure what should happen if avcodec_decode_audio4() returns 0. Currently, we throw away the packet in this case. We don't want to be stuck in an endless loop (could happen if the decoder produces no output either).
| * demux: refactorwm42013-07-113-145/+126
| |
| * core: don't access demux_stream outside of demux.c, make it privatewm42013-07-1113-123/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * tv: add hack in preparation of demux_stream removalwm42013-07-113-4/+25
| | | | | | | | | | | | | | | | | | | | Currently, all demuxer fill_buffer functions have a demux_stream parameter. We want to remove that, but the TV code still depends on it. Add a hack to remove that dependency. The problem with