Skip to content
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...
1 parent 2afb07d commit d5ce98e26d71500a48e5a40f544abb1fd9ca7684 @stichnot stichnot committed May 23, 2012
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;

0 comments on commit d5ce98e

Please sign in to comment.
Something went wrong with that request. Please try again.