Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Subtitles: Enable forced subtitle tracks. Refs #10735

If the subtitle track is marked as forced, mark each individual
subtitle as forced even if it isn't individually marked in the stream.
Some mkv rips of DVDs appear to be structured this way.
  • Loading branch information...
commit d5ce98e26d71500a48e5a40f544abb1fd9ca7684 1 parent 2afb07d
@stichnot stichnot authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 mythtv/libs/libmythtv/avformatdecoder.cpp
View
5 mythtv/libs/libmythtv/avformatdecoder.cpp
@@ -3442,6 +3442,7 @@ bool AvFormatDecoder::ProcessSubtitlePacket(AVStream *curstream, AVPacket *pkt)
avcodeclock->lock();
int subIdx = selectedTrack[kTrackTypeSubtitle].av_stream_index;
+ bool isForcedTrack = selectedTrack[kTrackTypeSubtitle].forced;
avcodeclock->unlock();
int gotSubtitles = 0;
@@ -3474,6 +3475,8 @@ bool AvFormatDecoder::ProcessSubtitlePacket(AVStream *curstream, AVPacket *pkt)
if (gotSubtitles)
{
+ if (isForcedTrack)
+ subtitle.forced = true;
subtitle.start_display_time += pts;
subtitle.end_display_time += pts;
LOG(VB_PLAYBACK | VB_TIMESTAMP, LOG_INFO, LOC +
@@ -3485,7 +3488,7 @@ bool AvFormatDecoder::ProcessSubtitlePacket(AVStream *curstream, AVPacket *pkt)
bool forcedon = m_parent->GetSubReader(pkt->stream_index)->AddAVSubtitle(
subtitle, curstream->codec->codec_id == CODEC_ID_XSUB,
m_parent->GetAllowForcedSubtitles());
- m_parent->EnableForcedSubtitles(forcedon);
+ m_parent->EnableForcedSubtitles(forcedon || isForcedTrack);
}
return true;
Please sign in to comment.
Something went wrong with that request. Please try again.