Commit Graph

36596 Commits

Author SHA1 Message Date
wm4 20d354cc0c vo_opengl: fix compilation
Never do a trivial change while drunk and without actually testing it.
2013-11-22 19:08:14 +01:00
wm4 de22d2b1ba vf_vavpp: make it work with vo_opengl and software decoding
vo_opengl always loads the hwdec backend lazily, so hwdec_request_api()
has to be called to possibly load it. This makes vf_vavpp work with
software decoding. (Hardware decoding loads the backend before the
filter is initialized, so this case is different.)

Also, the VFCTRL_GET_HWDEC_INFO call doesn't need to be checked. If it
fails, the info will be left blank.
2013-11-22 18:06:34 +01:00
wm4 0619272767 vo_opengl: initialize all fields for VFCTRL_GET_HWDEC_INFO
This initialized only the load_api and load_api_ctx fields, and left the
other fields as they were. This failed with vf_vavpp, which assumed all
fields are initialized.
2013-11-22 18:06:14 +01:00
wm4 f5eed454d4 build: unbreak PVR configure test 2013-11-22 14:55:19 +01:00
enkore 87a7886005 manpage: document , mapping (frame_back_step)
See #356
2013-11-22 13:07:36 +01:00
wm4 f405a468ae input.conf: fix typo 2013-11-22 13:00:26 +01:00
Josh Driver 5e6d9998f5 Fixing list of vo's that vavpp works with, in man page. 2013-11-22 11:39:26 +01:00
Stefano Pigozzi 3f594c2e84 cocoa: use window-scale to support video scaling functionality
In the cocoa backend you can use cmd+0/1/2 to scale the window. This commit
makes it use the new window-scale functionality.
2013-11-22 08:43:02 +01:00
Stefano Pigozzi ede608ed43 cocoa: implement window-scale 2013-11-22 08:41:34 +01:00
Stefano Pigozzi 7e2edad8ef switch the build system to waf
This commit adds a new build system based on waf. configure and Makefile
are deprecated effective immediately and someday in the future they will be
removed (they are still available by running ./old-configure).

You can find how the choice for waf came to be in `DOCS/waf-buildsystem.rst`.
TL;DR: we couldn't get the same level of abstraction and customization with
other build systems we tried (CMake and autotools).

For guidance on how to build the software now, take a look at README.md
and the cross compilation guide.

CREDITS:
This is a squash of ~250 commits. Some of them are not by me, so here is the
deserved attribution:

 - @wm4 contributed some Windows fixes, renamed configure to old-configure
   and contributed to the bootstrap script. Also, GNU/Linux testing.
 - @lachs0r contributed some Windows fixes and the bootstrap script.
 - @Nikoli contributed a lot of testing and discovered many bugs.
 - @CrimsonVoid contributed changes to the bootstrap script.
2013-11-21 21:22:36 +01:00
wm4 0cb9227a73 options: prefix options with "--" in help output
This is Better(tm).
2013-11-21 16:19:23 +01:00
wm4 5dca96c1a4 stream_lavf: fix a small memory leak
Also add an explanation why this special code path for rtsp is needed.
2013-11-21 16:16:08 +01:00
wm4 d585382f0e timeline: reject mplayer2 EDL files, change EDL header
This was forgotten when the parser for mplayer2 EDL files was removed.

Change the header of the mpv EDL format to include a '#', so a naive
parser could skip the header as comment. (Maybe this is questionable;
on the other hand, if it can be simpler, why not.)

Also, strip the header in demux_edl.c before passing on the data, so the
header check doesn't need to be duplicated in tl_mpv_edl.c.
2013-11-21 15:59:00 +01:00
wm4 287d2e0603 tech-overview.txt: minor update 2013-11-20 18:16:20 +01:00
wm4 801ff8319f ta: fix typo in comment 2013-11-20 18:13:05 +01:00
wm4 31fc48f0a8 osdep/io.c: include config.h
This possibly enables code that has never been tested before
(accidentally), so let's hope this works out ok.
2013-11-20 18:12:58 +01:00
wm4 702962878b mplayer: fix passing size_t as %d to printf() 2013-11-20 18:12:14 +01:00
wm4 52467b2ac9 timeline: remove support for the mplayer2 EDL format
It was a bit too complicated and inconvenient, and I doubt anyone
actively used it. The mpv EDL format should cover all use cases.
2013-11-19 22:44:08 +01:00
wm4 f197198ca3 player: add --merge-files option 2013-11-19 22:39:14 +01:00
wm4 04bdd7af72 timeline: add edl:// URIs
Questionable change from user perspective, but internally needed to
implement the next commit. Also useful for testing timeline stuff.
2013-11-19 22:39:04 +01:00
wm4 50837129b2 timeline: add new EDL format
Edit Decision Lists (EDL) allow combining parts from multiple source
files into one virtual file. MPlayer had an EDL format (which sucked),
which mplayer2 tried to improve with its own format (which sucked). As
logic demands, mpv introduces its very own format (which sucks).

The new format should actually be much simpler and easier to use, and
its implementation is simpler and smaller too.
2013-11-19 22:38:27 +01:00
wm4 469e488308 manpage: fix typo in --video-align-y description 2013-11-19 22:20:09 +01:00
wm4 b0c75a1ff9 player: select fallback stream in timeline code for better EDL handling
The intention of the existing code was trying to match demuxer-reported
stream IDs, instead of using possibly arbitrary ordering of the frontend
track list. But EDL files can consist of quite different files, for
which trying to match the stream IDs doesn't always make sense.
2013-11-19 22:18:56 +01:00
wm4 904ae96795 player: deselect video track if initialization fails
This didn't have any consequences, other than suddenly reinitializing
video when it works again (such as with EDL timeline mixing video and
audio-only files).
2013-11-19 22:16:56 +01:00
wm4 16233bc546 vdpau_old: enable OpenGL interop
OpenGL interop was essentially disabled, because the decoder didn't
request vdpau device creation from vo_opengl.
2013-11-19 22:15:28 +01:00
wm4 b14a7da5d4 ao_null: fix simulated buffer size
The size accidentally defaulted to 200 seconds instead of 200
milliseconds, which had fatal consequences when trying to use it.
2013-11-19 22:14:23 +01:00
wm4 85f6349c78 audio/filter: rename af_tools.c to tools.c
This always bothered me.
2013-11-18 18:48:00 +01:00
wm4 82068ec56c demux: rename demux_packet.h to packet.h
This always bothered me.
2013-11-18 18:46:44 +01:00
wm4 d5bc4ee798 audio: drop buffered filter data when seeking
This could lead to (barely) audible artifacts with --af=scaletempo and
modified playback speed.
2013-11-18 14:21:01 +01:00
wm4 5594718b6b audio/filter: remove unneeded AF_CONTROLs, convert to enum
The AF control commands used an elaborate and unnecessary organization
for the command constants. Get rid of all that and convert the
definitions to a simple enum. Also remove the control commands that
were not really needed, because they were not used outside of the
filters that implemented them.
2013-11-18 14:21:01 +01:00
wm4 93852b08f3 af: cleanup documentation comments
And by "cleanup", I mean "remove". Actually, only remove the parts that
are redundant and doxygen noise. Move useful parts to the comment above
the function's implementation in the C source file.
2013-11-18 14:21:01 +01:00
wm4 75dd3ec210 player: simplify audio reset when seeking
Some decoders used to read packets and decode data when calling
resync_audio_stream(). This required a special case in mp_seek() for
audio. (A comment mentions liba52, which is long gone; but until
recently ad_mpg123.c actually exposed this behavior.)

No decoder does this anymore, and resync_audio_stream() works similar
as resync_video_stream(). Remove the special case.
2013-11-18 14:21:01 +01:00
wm4 03f93dc7a2 stream_dvb: remove bogus free calls
The priv struct is now allocated by talloc in stream.c. It doesn't need
to be manually freed, and using free() instead of talloc_free() probably
crashes.
2013-11-18 14:21:01 +01:00
wm4 b1405f3cff vo_vdpau: don't calculate destination alpha when drawing OSD
Same as MPlayer svn commit r36515 "Chose cheaper alpha blend equation."

No idea if this is actually faster, but can't hurt.
2013-11-18 14:21:01 +01:00
wm4 1151dac5f0 audio: use the decoder buffer's format, not sh_audio
When the decoder detects a format change, it overwrites the values
stored in sh_audio (this affects the members sample_format, samplerate,
channels). In the case when the old audio data still needs to be
played/filtered, the audio format as identified by sh_audio and the
format used for the decoder buffer can mismatch. In particular, they
will mismatch in the very unlikely but possible case the audio chain is
reinitialized while old data is draining during a format change.

Or in other words, sh_audio might contain the new format, while the
audio chain is still configured to use the old format.

Currently, the audio code (player/audio.c and init_audio_filters) access
sh_audio to get the current format. This is in theory incorrect for the
reasons mentioned above. Use the decoder buffer's format instead, which
should be correct at any point.
2013-11-18 14:21:00 +01:00
wm4 8f1151a00e audio: fix mid-stream audio reconfiguration
Commit 22b3f522 not only redid major aspects of audio decoding, but also
attempted to fix audio format change handling. Before that commit, data
that was already decoded but not yet filtered was thrown away on a
format change. After that commit, data was supposed to finish playing
before rebuilding filters and so on.

It was still buggy, though: the decoder buffer was initialized to the
new format too early, triggering an assertion failure. Move the reinit
call below filtering to fix this.

ad_mpg123.c needs to be adjusted so that it doesn't decode new data
before the format change is actually executed.

Add some more assertions to af_play() (audio filtering) to make sure
input data and configured format don't mismatch. This will also catch
filters which don't set the format on their output data correctly.

Regression due to planar_audio branch.
2013-11-18 14:20:59 +01:00
wm4 b78d11d328 stream: split out pthread helper function
Also split the function itself into 3.
2013-11-17 16:42:57 +01:00
wm4 2556f45f2e af_lavrresample: set cutoff as double, not int
Regression introduced with commit a89549e8.
2013-11-17 16:22:35 +01:00
wm4 8438c557cf player: write final audo chunk only if there is audio left
Don't call ao_play() if there's nothing left. Of course this still asks
the AO to play internally buffered audio by setting drain=true.
2013-11-17 16:22:32 +01:00
wm4 e403140201 ao_null: properly simulate final chunk, add buffer options
Simulate proper handling of AOPLAY_FINAL_CHUNK. Print when underruns
occur (i.e. running out of data). Add some options that control
simulated buffer and outburst sizes.

All this is useful for debugging and self-documentation. (Note that
ao_null always was supposed to simulate an ideal AO, which is the reason
why it fools people who try to use it for benchmarking video.)
2013-11-17 16:22:25 +01:00
wm4 b3eed7374e player: don't remove playback status when reinitializing DVB
Also break that line a bit.
2013-11-17 16:22:14 +01:00
wm4 fde0e9e84d demux_packet: add source stream index
Might be helpful later.
2013-11-16 21:46:17 +01:00
wm4 5957f828b0 demux: update a comment 2013-11-16 21:46:17 +01:00
wm4 2ea23fd107 demux: remove unused commands
These were replaced with DEMUXER_CTRL_SWITCHED_TRACKS a while ago.
2013-11-16 21:46:17 +01:00
wm4 a2a24b957e demux: simplify handling of filepos field
demuxer->filepos contains the byte offset of the last read packet. This
is so that the player can estimate the current playback position, if no
proper timestamps are available. Simplify it to use demux_packet->pos in
the generic demuxer code, instead of bothering every demuxer
implementation about it.

(Note that this is still a bit incorrect: it relfects the position of
the last packet read by the demuxer, not that returned to the user. But
that was already broken, and is not that trivial to fix.)
2013-11-16 21:46:17 +01:00
wm4 0cdbc6db6e demux_lavf: remove broken and commented byte based seeks
This was originally added for better seeking where libavformat's seek
function won't work well: files with timestamp resets. In these cases,
the code tried to calculate an average bitrate, and then do byte based
seeks by multiplying the seek target time with the bitrate.

Apparently this was unreliable enough that the code was just commented
(and other parts became inactive). Get rid of it.

Note that the player still does byte based seeks in these cases when
doing percent-seeks.
2013-11-16 21:46:17 +01:00
wm4 7fbf87e615 demux: reset EOF flag differently
This should be almost equivalent, but is slightly better because the
EOF flag is reset earlier.
2013-11-16 21:46:17 +01:00
wm4 8cc44a64e8 encode_lavc: add missing newline in error message 2013-11-16 21:46:17 +01:00
wm4 ca455e65a3 ao_lavc: use af_format_conversion_score()
This should allow it to select better fallback formats, instead of
picking the first encoder sample format if ao->format is not equal to
any of the encoder sample formats.

Not sure what is supposed to happen if the encoder provides no
compatible sample format (or no sample format list at all), but in this
case ao_lavc.c still fails gracefully.
2013-11-16 21:46:17 +01:00
wm4 3f7e1f0492 audio/format: add heuristic to estimate loss on format conversion
The added function af_format_conversion_score() can be used to select
the best sample format to convert to in order to reduce loss and extra
conversion work.

It calculates a "loss" score when going from one format to another, and
for each conversion that needs to be done a certain score is subtracted.
Thus, if you have to convert from one format to a set of other formats,
you can calculate the score for each conversion, and pick the one with
the highest score.

Conversion between int and float is considered the worst case. One odd
consequence is that when converting from s32 to u8 or float, u8 will be
picked.

Test program used to develop this follows:

#define MAX_FMT 200
struct entry {
    const char *name;
    int score;
};

static int compentry(const void *px1, const void *px2)
{
    const struct entry *x1 = px1;
    const struct entry *x2 = px2;
    if (x1->score > x2->score)
        return 1;
    if (x1->score < x2->score)
        return -1;
    return 0;
}

int main(int argc, char *argv[])
{
    for (int n = 0; af_fmtstr_table[n].name; n++) {
        struct entry entry[MAX_FMT];
        int entries = 0;
        for (int i = 0; af_fmtstr_table[i].name; i++) {
            assert(i < MAX_FMT);
            entry[entries].name = af_fmtstr_table[i].name;
            entry[entries].score =
                af_format_conversion_score(af_fmtstr_table[i].format,
                                           af_fmtstr_table[n].format);
            entries++;
        }
        qsort(&entry[0], entries, sizeof(entry[0]), compentry);
        for (int i = 0; i < entries; i++) {
            printf("%s -> %s: %d \n", af_fmtstr_table[n].name,
                   entry[i].name, entry[i].score);
        }
    }
}
2013-11-16 21:46:17 +01:00