summaryrefslogtreecommitdiffstats
path: root/demux/demux_lavf.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-05 16:57:56 +0200
committerwm4 <wm4@nowhere>2014-07-05 17:07:15 +0200
commit338004bcfc224727d1477d303aa1521bf3ac21be (patch)
tree5066a689bb13f4c00a360d9b33a485d81eb17d72 /demux/demux_lavf.c
parent4d2a4afdef24c343b98e71dddcb3382e85c09c96 (diff)
downloadmpv-338004bcfc224727d1477d303aa1521bf3ac21be.tar.bz2
mpv-338004bcfc224727d1477d303aa1521bf3ac21be.tar.xz
dvd, bluray, cdda: add demux_disc containing all related hacks
DVD and Bluray (and to some extent cdda) require awful hacks all over the codebase to make them work. The main reason is that they act like container, but are entirely implemented on the stream layer. The raw mpeg data resulting from these streams must be "extended" with the container-like metadata transported via STREAM_CTRLs. The result were hacks all over demux.c and some higher-level parts. Add a "disc" pseudo-demuxer, and move all these hacks and special-cases to it.
Diffstat (limited to 'demux/demux_lavf.c')
-rw-r--r--demux/demux_lavf.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c
index 619f06b32b..3c18866312 100644
--- a/demux/demux_lavf.c
+++ b/demux/demux_lavf.c
@@ -54,6 +54,7 @@
#include "stheader.h"
#include "options/m_option.h"
+
#define INITIAL_PROBE_SIZE STREAM_BUFFER_SIZE
#define PROBE_BUF_SIZE FFMIN(STREAM_MAX_BUFFER_SIZE, 2 * 1024 * 1024)
@@ -153,8 +154,6 @@ static int64_t mp_seek(void *opaque, int64_t pos, int whence)
struct demuxer *demuxer = opaque;
struct stream *stream = demuxer->stream;
int64_t current_pos;
- if (stream_manages_timeline(stream))
- return -1;
MP_TRACE(demuxer, "mp_seek(%p, %"PRId64", %d)\n", stream, pos, whence);
if (whence == SEEK_END || whence == AVSEEK_SIZE) {
int64_t end;
@@ -264,8 +263,7 @@ static int lavf_check_file(demuxer_t *demuxer, enum demux_check check)
MP_FATAL(demuxer, "Unknown lavf format %s\n", format);
return -1;
}
- MP_INFO(demuxer, "Forced lavf %s demuxer\n",
- priv->avif->long_name);
+ MP_VERBOSE(demuxer, "Forced lavf %s demuxer\n", priv->avif->long_name);
goto success;
}
@@ -762,10 +760,6 @@ static int demux_open_lavf(demuxer_t *demuxer, enum demux_check check)
demuxer->start_time = priv->avfc->start_time == AV_NOPTS_VALUE ?
0 : (double)priv->avfc->start_time / AV_TIME_BASE;
- double time;
- if (stream_control(demuxer->stream, STREAM_CTRL_GET_START_TIME, &time) > 0)
- demuxer->start_time = time;
-
return 0;
}
@@ -816,12 +810,6 @@ static int demux_lavf_fill_buffer(demuxer_t *demux)
dp->duration = pkt->convergence_duration * av_q2d(st->time_base);
dp->pos = pkt->pos;
dp->keyframe = pkt->flags & AV_PKT_FLAG_KEY;
- // Use only one stream for stream_pts, otherwise PTS might be jumpy.
- if (stream->type == STREAM_VIDEO) {
- double pts;
- if (stream_control(demux->stream, STREAM_CTRL_GET_CURRENT_TIME, &pts) > 0)
- dp->stream_pts = pts;
- }
if (dp->pts != MP_NOPTS_VALUE) {
priv->last_pts = dp->pts * AV_TIME_BASE;
} else if (dp->dts != MP_NOPTS_VALUE) {