diff options
author | wm4 <wm4@nowhere> | 2012-11-16 19:12:56 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-11-16 21:21:16 +0100 |
commit | 7a1396b6ca73d5db194dcc6cebc5ad92e9b22c89 (patch) | |
tree | cfe2387465387659a5564c18acfbd2a9d5aa2012 /demux/demux.c | |
parent | f7163c80658651804437f9a7f5bed6fb34a32830 (diff) | |
download | mpv-7a1396b6ca73d5db194dcc6cebc5ad92e9b22c89.tar.bz2 mpv-7a1396b6ca73d5db194dcc6cebc5ad92e9b22c89.tar.xz |
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.
Diffstat (limited to 'demux/demux.c')
-rw-r--r-- | demux/demux.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/demux/demux.c b/demux/demux.c index 889fbea409..e45335f2f8 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -80,7 +80,6 @@ const demuxer_desc_t *const demuxer_list[] = { #ifdef CONFIG_TV &demuxer_desc_tv, #endif - &demuxer_desc_mf, &demuxer_desc_lavf_preferred, &demuxer_desc_avi, &demuxer_desc_asf, @@ -99,6 +98,8 @@ const demuxer_desc_t *const demuxer_list[] = { &demuxer_desc_mpeg4_es, &demuxer_desc_h264_es, &demuxer_desc_mpeg_ts, + // auto-probe last, because it checks file-extensions only + &demuxer_desc_mf, /* Please do not add any new demuxers here. If you want to implement a new * demuxer, add it to libavformat, except for wrappers around external * libraries and demuxers requiring binary support. */ |