Commit Graph

61 Commits

Author SHA1 Message Date
wm4 c4f33d784a demux: remove some old stream header functions 2013-07-08 00:35:04 +02:00
wm4 4f5e12136d stream: remove padding parameter from stream_read_complete()
Seems like a completely unnecessary complication. Instead, always add a
1 byte padding (could be extended if a caller needs it), and clear it.

Also add some documentation. There was some, but it was outdated and
incomplete.
2013-06-23 22:33:59 +02:00
wm4 be7e04f719 demux_mf: fix crashes when '*' matches directories
Doing 'mpv mf://*' in a file with directories would crash, because even
though directories are skipped, the corresponding file entry is just
left at NULL, leading to a segfault on access. So explicitly skip NULL
entries.
2013-03-19 01:54:45 +01:00
wm4 72bdc5d3af core: use playback time to determine playback percent position
The percent position is used for the OSD, the status line, and for the
OSD bar (shown on seeks). By default, the PTS of the last demuxed packet
was used to calculate it. This led to a "jumpy" display when the
percentage value (casted to int) was changing. The reasons for this were
the presence of video frame reordering (packet PTS is not monotonic), or
getting PTS values from different streams (like audio/subs).

Since these rely on PTS values and correct file durations anyway,
simplify it by calculating it with the current playback position in
mplayer.c instead.
2013-02-26 02:01:48 +01:00
wm4 4801c3c62c demux_mf: add some more image formats
And fix the comment about fourccs.
2013-02-24 17:23:38 +01:00
wm4 90efe7cf48 demux_mf: support .xbm
And support the PIX_FMT_MONOWHITE pixel format. (This is really weird:
unlike PIX_FMT_MONOBLACK, it uses white pixels. I have no idea why
libavcodec doesn't just convert the pixel format on the fly, instead of
bothering everyone with really special pixel formats.)
2013-02-24 16:51:29 +01:00
wm4 10ed11eefa demux_mf: map to codecs directly
Instead of going through FourCCs and codec_tags.c.
2013-02-24 16:31:43 +01:00
wm4 32500b5e11 demux_mf: fix breakage after commit 4d016a9 2013-02-17 21:06:26 +01:00
wm4 7a1396b6ca demux_mf: allow displaying single image files, various cleanups
Enable autoprobing for demux_mf, so that image files can be directly
displayed with e.g. "mpv file.jpg --pause". (The --pause switch is
needed to prevent the window from closing immediately.)

Since demux_mf doesn't have any real file format probing and goes by
file extension only, move the demuxer down the demuxer list to ensure
it's checked last. (ffmpeg's demux_mf equivalent, "image2", probes by
file extensions too, and there doesn't seem to be anything that can
probe typical image file formats from binary data.)

Remove the --mf "w" and "h" suboptions. Don't pass the width/height to
the video stream header. Both of these are useless, because the decoder
reads the real image size at a later point from the file headers.
Remove setting the BITMAPINFOHEADER as well, as vd_lavc doesn't need
this.

Enable --correct-pts by default. This fixes displaying a single image
with vo_vdpau (as mentioned by uau).

Keep around a pointer to the sh_video stream header instead of
accessing demuxer->video->sh_video. Fixes a crash when deselecting the
video track.

Note that the format probing is incorrect when opening images from HTTP
locations. File extensions don't have to match the actual file format.
A correct implementation would require to check the MIME type, or to
probe the binary data correctly.
2012-11-16 21:21:16 +01:00
wm4 4873b32c59 Rename directories, move files (step 2 of 2)
Finish renaming directories and moving files. Adjust all include
statements to make the previous commit compile.

The two commits are separate, because git is bad at tracking renames
and content changes at the same time.

Also take this as an opportunity to remove the separation between
"common" and "mplayer" sources in the Makefile. ("common" used to be
shared between mplayer and mencoder.)
2012-11-12 20:08:18 +01:00
wm4 d4bdd0473d Rename directories, move files (step 1 of 2) (does not compile)
Tis drops the silly lib prefixes, and attempts to organize the tree in
a more logical way. Make the top-level directory less cluttered as
well.

Renames the following directories:
    libaf -> audio/filter
    libao2 -> audio/out
    libvo -> video/out
    libmpdemux -> demux

Split libmpcodecs:
    vf* -> video/filter
    vd*, dec_video.* -> video/decode
    mp_image*, img_format*, ... -> video/
    ad*, dec_audio.* -> audio/decode

libaf/format.* is moved to audio/ - this is similar to how mp_image.*
is located in video/.

Move most top-level .c/.h files to core. (talloc.c/.h is left on top-
level, because it's external.) Park some of the more annoying files
in compat/. Some of these are relicts from the time mplayer used
ffmpeg internals.

sub/ is not split, because it's too much of a mess (subtitle code is
mixed with OSD display and rendering).

Maybe the organization of core is not ideal: it mixes playback core
(like mplayer.c) and utility helpers (like bstr.c/h). Should the need
arise, the playback core will be moved somewhere else, while core
contains all helper and common code.
2012-11-12 20:06:14 +01:00