summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-22 12:54:18 +0100
committerwm4 <wm4@nowhere>2014-12-22 12:54:18 +0100
commitb7d0db8bfed7e9dac40f62977b016b3b8e5fdbc7 (patch)
tree092684abd922e376afc11944517eb8cbbf04104f /demux
parent1ef56e9d080103f0f40797cb65592710c9b91a5e (diff)
downloadmpv-b7d0db8bfed7e9dac40f62977b016b3b8e5fdbc7.tar.bz2
mpv-b7d0db8bfed7e9dac40f62977b016b3b8e5fdbc7.tar.xz
demux_mf: add probing by mime type
Reuses the mime type table introduced in the previous commit.
Diffstat (limited to 'demux')
-rw-r--r--demux/demux_mf.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/demux/demux_mf.c b/demux/demux_mf.c
index fa42f52782..5bb2cf392a 100644
--- a/demux/demux_mf.c
+++ b/demux/demux_mf.c
@@ -33,6 +33,7 @@
#include "stream/stream.h"
#include "demux.h"
#include "stheader.h"
+#include "codec_tags.h"
#include "mf.h"
#define MF_MAX_FILE_SIZE (1024 * 1024 * 256)
@@ -186,7 +187,10 @@ static int demux_open_mf(demuxer_t *demuxer, enum demux_check check)
if (!mf || mf->nr_of_files < 1)
goto error;
- const char *codec = probe_format(mf, demuxer->opts->mf_type, check);
+ char *force_type = demuxer->opts->mf_type;
+ const char *codec = mp_map_mimetype_to_video_codec(demuxer->stream->mime_type);
+ if (!codec || (force_type && force_type[0]))
+ codec = probe_format(mf, force_type, check);
if (!codec)
goto error;