Skip to content
Permalink
Browse files

VideoPlayer: ffmpeg demuxer - discard all unneeded streams

  • Loading branch information...
FernetMenta authored and popcornmix committed Nov 11, 2016
1 parent 9378bbf commit 83426e9d646d6115394d673caf14702394b37a5d
Showing with 8 additions and 1 deletion.
  1. +8 −1 xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
@@ -1318,13 +1318,20 @@ void CDVDDemuxFFmpeg::CreateStreams(unsigned int program)
if(i != m_program)
m_pFormatContext->programs[i]->discard = AVDISCARD_ALL;
}
if(m_program != UINT_MAX)
if (m_program != UINT_MAX)
{
// add streams from selected program
for (unsigned int i = 0; i < m_pFormatContext->programs[m_program]->nb_stream_indexes; i++)
{
AddStream(m_pFormatContext->programs[m_program]->stream_index[i]);
}

// discard all unneeded streams
for (unsigned int i = 0; i < m_pFormatContext->nb_streams; i++)
{
if (GetStream(i) == nullptr)
m_pFormatContext->streams[i]->discard = AVDISCARD_ALL;
}
}
}
else

0 comments on commit 83426e9

Please sign in to comment.
You can’t perform that action at this time.