From 1e53fc3a159c6b3a4239f17501c2edc93d5020f3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 18 Aug 2016 21:03:01 +0200 Subject: 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. --- demux/demux_lavf.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'demux/demux_lavf.c') 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; -- cgit v1.2.3