File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -1124,15 +1124,15 @@ int CSession::GetChapter() const
11241124 }
11251125 }
11261126 }
1127- return - 1 ;
1127+ return 0 ;
11281128}
11291129
11301130int SESSION::CSession::GetChapterCount () const
11311131{
1132- if (m_adaptiveTree && m_adaptiveTree-> m_periods . size () > 1 )
1133- return static_cast < int >(m_adaptiveTree-> m_periods . size ()) ;
1132+ if (! m_adaptiveTree)
1133+ return 0 ;
11341134
1135- return 0 ;
1135+ return static_cast < int >(m_adaptiveTree-> m_periods . size ()) ;
11361136}
11371137
11381138const char * SESSION::CSession::GetChapterName (int ch) const
Original file line number Diff line number Diff line change @@ -490,12 +490,21 @@ bool CInputStreamAdaptive::IsRealTimeStream()
490490#if INPUTSTREAM_VERSION_LEVEL > 1
491491int CInputStreamAdaptive::GetChapter ()
492492{
493+ // Provide the current chapter number
494+ // chapter numbering starts from 1, specify 0 for no chapter
493495 return m_session ? m_session->GetChapter () : 0 ;
494496}
495497
496498int CInputStreamAdaptive::GetChapterCount ()
497499{
498- return m_session ? m_session->GetChapterCount () : 0 ;
500+ if (m_session)
501+ {
502+ const int count = m_session->GetChapterCount ();
503+ if (count > 1 )
504+ return count;
505+ }
506+ // Return 0 to prevent Kodi core from handling chapters
507+ return 0 ;
499508}
500509
501510const char * CInputStreamAdaptive::GetChapterName (int ch)
You can’t perform that action at this time.
0 commit comments