From 7a1396b6ca73d5db194dcc6cebc5ad92e9b22c89 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 16 Nov 2012 19:12:56 +0100 Subject: 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. --- core/cfg-mplayer.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'core') diff --git a/core/cfg-mplayer.h b/core/cfg-mplayer.h index 4c7098af2c..531b3700ac 100644 --- a/core/cfg-mplayer.h +++ b/core/cfg-mplayer.h @@ -190,15 +190,11 @@ const m_option_t scaler_filter_conf[]={ extern char *dvd_device, *cdrom_device; -extern int mf_w; -extern int mf_h; extern double mf_fps; extern char * mf_type; extern m_obj_list_t vf_obj_list; const m_option_t mfopts_conf[]={ - {"w", &mf_w, CONF_TYPE_INT, 0, 0, 0, NULL}, - {"h", &mf_h, CONF_TYPE_INT, 0, 0, 0, NULL}, {"fps", &mf_fps, CONF_TYPE_DOUBLE, 0, 0, 0, NULL}, {"type", &mf_type, CONF_TYPE_STRING, 0, 0, 0, NULL}, {NULL, NULL, 0, 0, 0, 0, NULL} -- cgit v1.2.3