summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-10-06 04:28:59 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-10-06 04:48:00 +0300
commit7fd3eb0f74e7986e07556077ed654bad7869add8 (patch)
tree8d293145c0ef2bc31ca63f79dccb4e3b57294c82 /libmpdemux
parentef438b3a6b5bc714d521dd46d3ccb798ecd31eed (diff)
parentcbbc886820e981f488660708678f528e1d243121 (diff)
downloadmpv-7fd3eb0f74e7986e07556077ed654bad7869add8.tar.bz2
mpv-7fd3eb0f74e7986e07556077ed654bad7869add8.tar.xz
Merge svn changes up to r29752
As part of merging subtitle-in-terminal changes make update_subtitles() only clear existing subtitles if called with the reset argument, and not try to set new ones. Later calls should set the needed new subtitles, and this change avoids some problems with trying to set subtitles when mp_property_sub() in command.c gets called from initialization code before full initialization.
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_lavf.c5
-rw-r--r--libmpdemux/demux_mkv.c32
-rw-r--r--libmpdemux/demux_ts.c1
-rw-r--r--libmpdemux/mp_taglists.c3
4 files changed, 13 insertions, 28 deletions
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c
index 31eabc67a1..f69f2715ff 100644
--- a/libmpdemux/demux_lavf.c
+++ b/libmpdemux/demux_lavf.c
@@ -623,7 +623,10 @@ static void demux_seek_lavf(demuxer_t *demuxer, float rel_seek_secs, float audio
} else {
priv->last_pts += rel_seek_secs * AV_TIME_BASE;
}
- av_seek_frame(priv->avfc, -1, priv->last_pts, avsflags);
+ if (av_seek_frame(priv->avfc, -1, priv->last_pts, avsflags) < 0) {
+ avsflags ^= AVSEEK_FLAG_BACKWARD;
+ av_seek_frame(priv->avfc, -1, priv->last_pts, avsflags);
+ }
}
static int demux_lavf_control(demuxer_t *demuxer, int cmd, void *arg)
diff --git a/libmpdemux/demux_mkv.c b/libmpdemux/demux_mkv.c
index 118217e999..8280a8793e 100644
--- a/libmpdemux/demux_mkv.c
+++ b/libmpdemux/demux_mkv.c
@@ -240,30 +240,10 @@ add_cluster_position (mkv_demuxer_t *mkv_d, uint64_t position)
static int
aac_get_sample_rate_index (uint32_t sample_rate)
{
- if (92017 <= sample_rate)
- return 0;
- else if (75132 <= sample_rate)
- return 1;
- else if (55426 <= sample_rate)
- return 2;
- else if (46009 <= sample_rate)
- return 3;
- else if (37566 <= sample_rate)
- return 4;
- else if (27713 <= sample_rate)
- return 5;
- else if (23004 <= sample_rate)
- return 6;
- else if (18783 <= sample_rate)
- return 7;
- else if (13856 <= sample_rate)
- return 8;
- else if (11502 <= sample_rate)
- return 9;
- else if (9391 <= sample_rate)
- return 10;
- else
- return 11;
+ static const int srates[] = {92017, 75132, 55426, 46009, 37566, 27713, 23004, 18783, 13856, 11502, 9391, 0};
+ int i = 0;
+ while (sample_rate < srates[i]) i++;
+ return i;
}
/** \brief Free cached demux packets
@@ -1637,7 +1617,7 @@ demux_mkv_open_video (demuxer_t *demuxer, mkv_track_t *track, int vid)
uint32_t type2;
unsigned int cnt;
- src = track->private_data + RVPROPERTIES_SIZE;
+ src = (uint8_t *)track->private_data + RVPROPERTIES_SIZE;
cnt = track->private_size - RVPROPERTIES_SIZE;
bih = realloc(bih, sizeof (BITMAPINFOHEADER)+8+cnt);
@@ -2992,7 +2972,7 @@ demux_mkv_seek (demuxer_t *demuxer, float rel_seek_secs, float audio_delay, int
target_filepos = (uint64_t) (target_timecode * mkv_d->last_filepos
/ (mkv_d->last_pts * 1000.0));
- max_pos = mkv_d->cluster_positions[mkv_d->num_cluster_pos-1];
+ max_pos = mkv_d->num_cluster_pos ? mkv_d->cluster_positions[mkv_d->num_cluster_pos-1] : 0;
if (target_filepos > max_pos)
{
if ((off_t) max_pos > stream_tell (s))
diff --git a/libmpdemux/demux_ts.c b/libmpdemux/demux_ts.c
index 109275a7fa..c7966da9ba 100644
--- a/libmpdemux/demux_ts.c
+++ b/libmpdemux/demux_ts.c
@@ -2521,6 +2521,7 @@ static int parse_pmt(ts_priv_t * priv, uint16_t progid, uint16_t pid, int is_sta
break;
case 0x8A:
case 0x82:
+ case 0x85:
case 0x86:
pmt->es[idx].type = AUDIO_DTS;
break;
diff --git a/libmpdemux/mp_taglists.c b/libmpdemux/mp_taglists.c
index 12281ae997..286a755f8b 100644
--- a/libmpdemux/mp_taglists.c
+++ b/libmpdemux/mp_taglists.c
@@ -48,7 +48,6 @@ static const struct mp_AVCodecTag mp_wav_tags[] = {
{ CODEC_ID_ROQ_DPCM, MKTAG('R', 'o', 'Q', 'A')},
{ CODEC_ID_SHORTEN, MKTAG('s', 'h', 'r', 'n')},
{ 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')},
@@ -78,6 +77,7 @@ static const struct mp_AVCodecTag mp_codecid_override_tags[] = {
{ CODEC_ID_PCM_S32LE, 1},
{ CODEC_ID_MP2, 0x50},
{ CODEC_ID_MPEG2VIDEO, MKTAG('M', 'P', 'G', '2')},
+ { CODEC_ID_TRUEHD, MKTAG('T', 'R', 'H', 'D')},
{ 0, 0 },
};
@@ -88,6 +88,7 @@ static const struct mp_AVCodecTag mp_bmp_tags[] = {
{ CODEC_ID_BETHSOFTVID, MKTAG('B', 'E', 'T', 'H')},
{ CODEC_ID_BFI, MKTAG('B', 'F', 'I', 'V')},
{ CODEC_ID_C93, MKTAG('C', '9', '3', 'V')},
+ { CODEC_ID_DNXHD, MKTAG('A', 'V', 'd', 'n')},
{ CODEC_ID_DSICINVIDEO, MKTAG('D', 'C', 'I', 'V')},
{ CODEC_ID_DXA, MKTAG('D', 'X', 'A', '1')},
{ CODEC_ID_FLIC, MKTAG('F', 'L', 'I', 'C')},