summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-08-18 21:03:01 +0200
committerwm4 <wm4@nowhere>2016-08-18 21:03:01 +0200
commit1e53fc3a159c6b3a4239f17501c2edc93d5020f3 (patch)
treeb8c7b14e6ff4c1242e9c551f5413b96c92a1d88b /demux
parenta1dec6f54a31180968d3c8e5012bb3ccd1a7c716 (diff)
downloadmpv-1e53fc3a159c6b3a4239f17501c2edc93d5020f3.tar.bz2
mpv-1e53fc3a159c6b3a4239f17501c2edc93d5020f3.tar.xz
demux_lavf: don't report start time for ogg
Better with ogg shoutcast streams. These have PTS resets on each playlist item, so the PTS would usually reset to some negative value.
Diffstat (limited to 'demux')
-rw-r--r--demux/demux_lavf.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c
index e28ebd0c23..ef0a8583d5 100644
--- a/demux/demux_lavf.c
+++ b/demux/demux_lavf.c
@@ -114,6 +114,7 @@ struct format_hack {
// Do not confuse player's position estimation (position is into external
// segment, with e.g. HLS, player knows about the playlist main file only).
bool clear_filepos : 1;
+ bool ignore_start : 1;
};
#define BLACKLIST(fmt) {fmt, .ignore = true}
@@ -137,6 +138,9 @@ static const struct format_hack format_hacks[] = {
{"h264", .if_flags = AVFMT_NOTIMESTAMPS },
{"hevc", .if_flags = AVFMT_NOTIMESTAMPS },
+ // Rebasing start time to 0 is very weird with ogg shoutcast streams.
+ {"ogg", .ignore_start = true},
+
TEXTSUB("aqtitle"), TEXTSUB("jacosub"), TEXTSUB("microdvd"),
TEXTSUB("mpl2"), TEXTSUB("mpsub"), TEXTSUB("pjs"), TEXTSUB("realtext"),
TEXTSUB("sami"), TEXTSUB("srt"), TEXTSUB("stl"), TEXTSUB("subviewer"),
@@ -855,8 +859,8 @@ static int demux_open_lavf(demuxer_t *demuxer, enum demux_check check)
demuxer->ts_resets_possible =
priv->avif_flags & (AVFMT_TS_DISCONT | AVFMT_NOTIMESTAMPS);
- demuxer->start_time = priv->avfc->start_time == AV_NOPTS_VALUE ?
- 0 : (double)priv->avfc->start_time / AV_TIME_BASE;
+ if (avfc->start_time != AV_NOPTS_VALUE && !priv->format_hack.ignore_start)
+ demuxer->start_time = avfc->start_time / (double)AV_TIME_BASE;
demuxer->fully_read = priv->format_hack.fully_read;