summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-07-12 21:58:11 +0200
committerwm4 <wm4@nowhere>2013-07-12 22:16:26 +0200
commit3269bd178020c5d821e8b2d1fd807a38d63e93ce (patch)
tree474e0f7a712cc7002984ec1bdda7d445b5fd8c77 /core
parent311d2f199a7b1f4d819cfb799a0f0f571596b91e (diff)
downloadmpv-3269bd178020c5d821e8b2d1fd807a38d63e93ce.tar.bz2
mpv-3269bd178020c5d821e8b2d1fd807a38d63e93ce.tar.xz
demux: rewrite probing and demuxer initialization
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.
Diffstat (limited to 'core')
-rw-r--r--core/mplayer.c6
-rw-r--r--core/options.c2
-rw-r--r--core/options.h1
-rw-r--r--core/timeline/tl_matroska.c2
4 files changed, 4 insertions, 7 deletions
diff --git a/core/mplayer.c b/core/mplayer.c
index ecaa9dd10b..de6b4132fd 100644
--- a/core/mplayer.c
+++ b/core/mplayer.c
@@ -2297,9 +2297,9 @@ int reinit_video_chain(struct MPContext *mpctx)
goto no_video;
}
- mp_tmsg(MSGT_CPLAYER, MSGL_V, "[V] filefmt:%d fourcc:0x%X "
+ mp_tmsg(MSGT_CPLAYER, MSGL_V, "[V] fourcc:0x%X "
"size:%dx%d fps:%5.3f\n",
- mpctx->master_demuxer->file_format, mpctx->sh_video->format,
+ mpctx->sh_video->format,
mpctx->sh_video->disp_w, mpctx->sh_video->disp_h,
mpctx->sh_video->fps);
if (opts->force_fps)
@@ -2459,7 +2459,7 @@ static struct demux_packet *video_read_frame(struct MPContext *mpctx)
double d = next_pts == MP_NOPTS_VALUE ? sh_video->last_pts - pts1
: next_pts - sh_video->last_pts;
if (d >= 0) {
- if (demuxer->file_format == DEMUXER_TYPE_TV) {
+ if (demuxer->type == DEMUXER_TYPE_TV) {
if (d > 0)
sh_video->fps = 1.0f / d;
frame_time = d;
diff --git a/core/options.c b/core/options.c
index d676cb4948..2298d112b8 100644
--- a/core/options.c
+++ b/core/options.c
@@ -399,7 +399,6 @@ const m_option_t mp_opts[] = {
OPT_STRING("demuxer", demuxer_name, 0),
OPT_STRING("audio-demuxer", audio_demuxer_name, 0),
OPT_STRING("sub-demuxer", sub_demuxer_name, 0),
- OPT_FLAG("extbased", extension_parsing, 0),
{"mf", (void *) mfopts_conf, CONF_TYPE_SUBCONFIG, 0,0,0, NULL},
#ifdef CONFIG_RADIO
@@ -777,7 +776,6 @@ const struct MPOpts mp_default_opts = {
.sub_visibility = 1,
.sub_pos = 100,
.sub_speed = 1.0,
- .extension_parsing = 1,
.audio_output_channels = MP_CHMAP_INIT_STEREO,
.audio_output_format = -1, // AF_FORMAT_UNKNOWN
.playback_speed = 1.,
diff --git a/core/options.h b/core/options.h
index d46435bf9e..345835656b 100644
--- a/core/options.h
+++ b/core/options.h
@@ -152,7 +152,6 @@ typedef struct MPOpts {
char *demuxer_name;
char *audio_demuxer_name;
char *sub_demuxer_name;
- int extension_parsing;
int mkv_subtitle_preroll;
struct image_writer_opts *screenshot_image_opts;
diff --git a/core/timeline/tl_matroska.c b/core/timeline/tl_matroska.c
index 614ce0d6b7..f01160b60e 100644
--- a/core/timeline/tl_matroska.c
+++ b/core/timeline/tl_matroska.c
@@ -168,7 +168,7 @@ static bool check_file_seg(struct MPContext *mpctx, struct demuxer **sources,
free_stream(s);
return was_valid;
}
- if (d->file_format == DEMUXER_TYPE_MATROSKA) {
+ if (d->type == DEMUXER_TYPE_MATROSKA) {
for (int i = 1; i < num_sources; i++) {
if (sources[i])
continue;