From e0024d2f579334650a5d10aaa9bb068c23b83385 Mon Sep 17 00:00:00 2001 From: Eli K Date: Thu, 6 Mar 2014 00:44:54 +0200 Subject: [PATCH] Do not allow non-content stream types to extend the format context's duration as this affects the UI and therefore seek capabilities. DVB subtitle/teletext streams are private streams (stream type 0xBD) and may have their own timebase or PTS values that are widely different than video stream's, or not set properly. Regardless of any handling of such cases in FFmpeg, XBMC shouldn't extend play duration unless an actual content stream has passed it's "end". --- xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp index 1146c6f079057..29f9398ceefc4 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp @@ -790,7 +790,8 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() // check if stream has passed full duration, needed for live streams - if(m_pkt.pkt.dts != (int64_t)AV_NOPTS_VALUE) + bool bAllowDurationExt = (stream->codec && (stream->codec->codec_type == AVMEDIA_TYPE_VIDEO || stream->codec->codec_type == AVMEDIA_TYPE_AUDIO)); + if(bAllowDurationExt && m_pkt.pkt.dts != (int64_t)AV_NOPTS_VALUE) { int64_t duration; duration = m_pkt.pkt.dts;