Skip to content

Commit

Permalink
AvFormatDecoder::autoSelectVideoTrack(): fully select the track
Browse files Browse the repository at this point in the history
The only functional change is to also set m_currentTrack[kTrackTypeVideo] to fully
select the video track since those variables are not not used before the call
to autoSelectVideoTrack() later in ScanStreams().

m_currentTrack[kTrackTypeVideo] would have been set to the same value later by
AutoSelectTrack().
  • Loading branch information
ulmus-scott authored and bennettpeter committed Jan 6, 2025
1 parent 97b14e3 commit b4bc47b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions mythtv/libs/libmythtv/decoders/avformatdecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1881,6 +1881,11 @@ void AvFormatDecoder::ScanDSMCCStreams(AVBufferRef* pmt_section)

int AvFormatDecoder::autoSelectVideoTrack(int& scanerror)
{
m_tracks[kTrackTypeVideo].clear();
m_selectedTrack[kTrackTypeVideo].m_av_stream_index = -1;
m_currentTrack[kTrackTypeVideo] = -1;
m_fps = 0;

const AVCodec *codec = nullptr;
LOG(VB_PLAYBACK, LOG_INFO, LOC + "Trying to select best video track");

Expand Down Expand Up @@ -1912,6 +1917,7 @@ int AvFormatDecoder::autoSelectVideoTrack(int& scanerror)

m_tracks[kTrackTypeVideo].push_back(si);
m_selectedTrack[kTrackTypeVideo] = si;
m_currentTrack[kTrackTypeVideo] = m_tracks[kTrackTypeVideo].size() - 1;

QString codectype(AVMediaTypeToString(codecContext->codec_type));
if (codecContext->codec_type == AVMEDIA_TYPE_VIDEO)
Expand Down Expand Up @@ -2113,13 +2119,7 @@ int AvFormatDecoder::ScanStreams(bool novideo)
m_tracks[kTrackTypeTeletextCaptions].clear();
m_tracks[kTrackTypeTeletextMenu].clear();
m_tracks[kTrackTypeRawText].clear();
if (!novideo)
{
// we will rescan video streams
m_tracks[kTrackTypeVideo].clear();
m_selectedTrack[kTrackTypeVideo].m_av_stream_index = -1;
m_fps = 0;
}

std::map<int,uint> lang_sub_cnt;
uint subtitleStreamCount = 0;
std::map<int,uint> lang_aud_cnt;
Expand Down

0 comments on commit b4bc47b

Please sign in to comment.