Skip to content

Commit

Permalink
AvFormatDecoder: Add a GetSubHeader method.
Browse files Browse the repository at this point in the history
This is the first of the SSA support patches. Refs #9294
  • Loading branch information
Mark Kendall committed May 3, 2011
1 parent fbe0feb commit 4b48823
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mythtv/libs/libmythtv/avformatdecoder.cpp
Expand Up @@ -3365,6 +3365,19 @@ QString AvFormatDecoder::GetXDS(const QString &key) const
return ccd608->GetXDS(key);
}

QByteArray AvFormatDecoder::GetSubHeader(uint trackNo) const
{
if (trackNo >= tracks[kTrackTypeSubtitle].size())
return QByteArray();

int index = tracks[kTrackTypeSubtitle][trackNo].av_stream_index;
if (!ic->streams[index]->codec)
return QByteArray();

return QByteArray((char *)ic->streams[index]->codec->subtitle_header,
ic->streams[index]->codec->subtitle_header_size);
}

bool AvFormatDecoder::SetAudioByComponentTag(int tag)
{
for (uint i = 0; i < tracks[kTrackTypeAudio].size(); i++)
Expand Down
1 change: 1 addition & 0 deletions mythtv/libs/libmythtv/avformatdecoder.h
Expand Up @@ -168,6 +168,7 @@ class AvFormatDecoder : public DecoderBase
virtual int GetTeletextDecoderType(void) const;

virtual QString GetXDS(const QString&) const;
virtual QByteArray GetSubHeader(uint trackNo) const;

// MHEG stuff
virtual bool SetAudioByComponentTag(int tag);
Expand Down
1 change: 1 addition & 0 deletions mythtv/libs/libmythtv/decoderbase.h
Expand Up @@ -194,6 +194,7 @@ class DecoderBase
virtual int GetTeletextDecoderType(void) const { return -1; }

virtual QString GetXDS(const QString&) const { return QString::null; }
virtual QByteArray GetSubHeader(uint trackNo) const { return QByteArray(); }

// MHEG/MHI stuff
virtual bool SetAudioByComponentTag(int) { return false; }
Expand Down

0 comments on commit 4b48823

Please sign in to comment.