summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_audio.c3
-rw-r--r--libmpdemux/demux_lavf.c28
-rw-r--r--libmpdemux/demuxer.c4
-rw-r--r--libmpdemux/extension.c2
-rw-r--r--libmpdemux/mp_taglists.c8
-rw-r--r--libmpdemux/mp_taglists.h6
6 files changed, 29 insertions, 22 deletions
diff --git a/libmpdemux/demux_audio.c b/libmpdemux/demux_audio.c
index aa950046c6..f20c7d52f1 100644
--- a/libmpdemux/demux_audio.c
+++ b/libmpdemux/demux_audio.c
@@ -528,11 +528,10 @@ static int demux_audio_open(demuxer_t* demuxer) {
}
-static int demux_audio_fill_buffer(demuxer_t *demuxer, demux_stream_t *ds) {
+static int demux_audio_fill_buffer(demuxer_t *demux, demux_stream_t *ds) {
int l;
demux_packet_t* dp;
sh_audio_t* sh_audio = ds->sh;
- demuxer_t* demux = ds->demuxer;
da_priv_t* priv = demux->priv;
double this_pts = priv->next_pts;
stream_t* s = demux->stream;
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c
index fb89accaf3..31eabc67a1 100644
--- a/libmpdemux/demux_lavf.c
+++ b/libmpdemux/demux_lavf.c
@@ -172,16 +172,18 @@ static int lavf_check_file(demuxer_t *demuxer){
static const char * const preferred_list[] = {
"dxa",
- "wv",
- "nuv",
- "nut",
- "gxf",
- "mxf",
"flv",
- "swf",
+ "gxf",
+ "nut",
+ "nuv",
"mov,mp4,m4a,3gp,3g2,mj2",
"mpc",
"mpc8",
+ "mxf",
+ "swf",
+ "vqf",
+ "w64",
+ "wv",
NULL
};
@@ -240,8 +242,6 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i) {
// mp4a tag is used for all mp4 files no matter what they actually contain
if(codec->codec_tag == MKTAG('m', 'p', '4', 'a'))
codec->codec_tag= 0;
- if(codec->codec_id == CODEC_ID_ADPCM_IMA_AMV)
- codec->codec_tag= MKTAG('A','M','V','A');
if(!codec->codec_tag)
codec->codec_tag= mp_av_codec_get_tag(mp_wav_taglists, codec->codec_id);
wf->wFormatTag= codec->codec_tag;
@@ -490,6 +490,8 @@ static demuxer_t* demux_open_lavf(demuxer_t *demuxer){
demuxer_add_chapter(demuxer, t ? t->value : NULL, start, end);
}
+ for(i=0; i<avfc->nb_streams; i++)
+ handle_stream(demuxer, avfc, i);
if(avfc->nb_programs) {
int p, start=0, found=0;
@@ -511,15 +513,11 @@ static demuxer_t* demux_open_lavf(demuxer_t *demuxer){
AVProgram *program = avfc->programs[p];
t = av_metadata_get(program->metadata, "title", NULL, 0);
mp_msg(MSGT_HEADER,MSGL_INFO,"LAVF: Program %d %s\n", program->id, t ? t->value : "");
- for(i=0; i<program->nb_stream_indexes; i++)
- handle_stream(demuxer, avfc, program->stream_index[i]);
if(!priv->cur_program && (demuxer->video->sh || demuxer->audio->sh))
priv->cur_program = program->id;
p = (p + 1) % avfc->nb_programs;
} while(p!=start);
- } else
- for(i=0; i<avfc->nb_streams; i++)
- handle_stream(demuxer, avfc, i);
+ }
mp_msg(MSGT_HEADER,MSGL_V,"LAVF: %d audio and %d video streams found\n",priv->audio_streams,priv->video_streams);
mp_msg(MSGT_HEADER,MSGL_V,"LAVF: build %d\n", LIBAVFORMAT_BUILD);
@@ -714,6 +712,7 @@ static int demux_lavf_control(demuxer_t *demuxer, int cmd, void *arg)
demux_program_t *prog = arg;
AVProgram *program;
int p, i;
+ int start;
if(priv->avfc->nb_programs < 2)
return DEMUXER_CTRL_NOTIMPL;
@@ -735,6 +734,7 @@ static int demux_lavf_control(demuxer_t *demuxer, int cmd, void *arg)
p = i;
}
prog->vid = prog->aid = prog->sid = -2; //no audio and no video by default
+ start = p;
redo:
program = priv->avfc->programs[p];
for(i=0; i<program->nb_stream_indexes; i++)
@@ -758,6 +758,8 @@ redo:
if(prog->progid == -1 && prog->vid == -2 && prog->aid == -2)
{
p = (p + 1) % priv->avfc->nb_programs;
+ if (p == start)
+ return DEMUXER_CTRL_DONTKNOW;
goto redo;
}
priv->cur_program = prog->progid = program->id;
diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c
index 1c39b236e1..d08d97468b 100644
--- a/libmpdemux/demuxer.c
+++ b/libmpdemux/demuxer.c
@@ -1158,6 +1158,10 @@ int demux_info_add(demuxer_t *demuxer, const char *opt, const char *param)
for (n = 0; info && info[2 * n] != NULL; n++) {
if (!strcasecmp(opt, info[2 * n])) {
+ if (!strcmp(param, info[2 * n + 1])) {
+ mp_msg(MSGT_DEMUX, MSGL_V, "Demuxer info %s set to unchanged value %s\n", opt, param);
+ return 0;
+ }
mp_tmsg(MSGT_DEMUX, MSGL_INFO, "Demuxer info %s changed to %s\n", opt,
param);
free(info[2 * n + 1]);
diff --git a/libmpdemux/extension.c b/libmpdemux/extension.c
index 539dd043b4..59d242e4dd 100644
--- a/libmpdemux/extension.c
+++ b/libmpdemux/extension.c
@@ -65,7 +65,7 @@ static struct {
{ "it", DEMUXER_TYPE_XMMS },
{ "mid", DEMUXER_TYPE_XMMS },
{ "midi", DEMUXER_TYPE_XMMS },
- { "vqf", DEMUXER_TYPE_XMMS },
+ { "vqf", DEMUXER_TYPE_LAVF },
{ "nsv", DEMUXER_TYPE_NSV },
{ "nsa", DEMUXER_TYPE_NSV },
{ "mpc", DEMUXER_TYPE_MPC },
diff --git a/libmpdemux/mp_taglists.c b/libmpdemux/mp_taglists.c
index 6ae9235191..12281ae997 100644
--- a/libmpdemux/mp_taglists.c
+++ b/libmpdemux/mp_taglists.c
@@ -50,17 +50,19 @@ static const struct mp_AVCodecTag mp_wav_tags[] = {
{ CODEC_ID_SPEEX, MKTAG('s', 'p', 'x', ' ')},
{ CODEC_ID_TRUEHD, MKTAG('T', 'R', 'H', 'D')},
{ CODEC_ID_TTA, MKTAG('T', 'T', 'A', '1')},
+ { CODEC_ID_TWINVQ, MKTAG('T', 'W', 'I', '2')},
{ CODEC_ID_WAVPACK, MKTAG('W', 'V', 'P', 'K')},
{ CODEC_ID_WESTWOOD_SND1, MKTAG('S', 'N', 'D', '1')},
{ CODEC_ID_XAN_DPCM, MKTAG('A', 'x', 'a', 'n')},
{ 0, 0 },
};
-const struct mp_AVCodecTag *mp_wav_taglists[] = {mp_ff_codec_wav_tags, mp_wav_tags, 0};
+const struct mp_AVCodecTag * const mp_wav_taglists[] = {mp_ff_codec_wav_tags, mp_wav_tags, 0};
static const struct mp_AVCodecTag mp_codecid_override_tags[] = {
{ CODEC_ID_AAC, MKTAG('M', 'P', '4', 'A')},
{ CODEC_ID_AC3, 0x2000},
+ { CODEC_ID_ADPCM_IMA_AMV, MKTAG('A', 'M', 'V', 'A')},
{ CODEC_ID_DTS, 0x2001},
{ CODEC_ID_EAC3, MKTAG('E', 'A', 'C', '3')},
{ CODEC_ID_H264, MKTAG('H', '2', '6', '4')},
@@ -79,7 +81,7 @@ static const struct mp_AVCodecTag mp_codecid_override_tags[] = {
{ 0, 0 },
};
-const struct mp_AVCodecTag *mp_codecid_override_taglists[] = {mp_codecid_override_tags, 0};
+const struct mp_AVCodecTag * const mp_codecid_override_taglists[] = {mp_codecid_override_tags, 0};
static const struct mp_AVCodecTag mp_bmp_tags[] = {
{ CODEC_ID_AMV, MKTAG('A', 'M', 'V', 'V')},
@@ -110,4 +112,4 @@ static const struct mp_AVCodecTag mp_bmp_tags[] = {
{ 0, 0 },
};
-const struct mp_AVCodecTag *mp_bmp_taglists[] = {mp_ff_codec_bmp_tags, mp_bmp_tags, 0};
+const struct mp_AVCodecTag * const mp_bmp_taglists[] = {mp_ff_codec_bmp_tags, mp_bmp_tags, 0};
diff --git a/libmpdemux/mp_taglists.h b/libmpdemux/mp_taglists.h
index 81c0b35d86..381b77a8db 100644
--- a/libmpdemux/mp_taglists.h
+++ b/libmpdemux/mp_taglists.h
@@ -23,10 +23,10 @@
#include "ffmpeg_files/taglists.h"
-extern const struct mp_AVCodecTag *mp_wav_taglists[];
+extern const struct mp_AVCodecTag * const mp_wav_taglists[];
-extern const struct mp_AVCodecTag *mp_codecid_override_taglists[];
+extern const struct mp_AVCodecTag * const mp_codecid_override_taglists[];
-extern const struct mp_AVCodecTag *mp_bmp_taglists[];
+extern const struct mp_AVCodecTag * const mp_bmp_taglists[];
#endif /* MPLAYER_MP_TAGLISTS_H */