Skip to content

Commit

Permalink
Fix a bunch more of the ffmpeg deprecated stuff in plugins
Browse files Browse the repository at this point in the history
This should get rid of almost all our plugin warnings.  Thanks to Mark Kendall
for fixing it in the core of mythtv and giving great examples of how to fix it
for the plugins.
  • Loading branch information
Beirdo committed May 8, 2011
1 parent 50d00e9 commit b7b6b11
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 15 deletions.
2 changes: 1 addition & 1 deletion mythplugins/mytharchive/mytharchive/thumbfinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ bool ThumbFinder::initAVCodec(const QString &inFile)
return false;
}
av_estimate_timings(m_inputFC, 0);
dump_format(m_inputFC, 0, inFileBA.constData(), 0);
av_dump_format(m_inputFC, 0, inFileBA.constData(), 0);

// find the first video stream
m_videostream = -1;
Expand Down
16 changes: 11 additions & 5 deletions mythplugins/mytharchive/mytharchivehelper/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2182,7 +2182,7 @@ static int getFileInfo(QString inFile, QString outFile, int lenMethod)
av_estimate_timings(inputFC, 0);

// Dump stream information
dump_format(inputFC, 0, inFileBA.constData(), 0);
av_dump_format(inputFC, 0, inFileBA.constData(), 0);

QDomDocument doc("FILEINFO");

Expand Down Expand Up @@ -2330,8 +2330,11 @@ static int getFileInfo(QString inFile, QString outFile, int lenMethod)
stream.setAttribute("codec", codec.trimmed());

stream.setAttribute("channels", st->codec->channels);
if (strlen(st->language) > 0)
stream.setAttribute("language", st->language);

AVMetadataTag *metatag =
av_metadata_get(st->metadata, "language", NULL, 0);
if (metatag)
stream.setAttribute("language", metatag->value);
else
stream.setAttribute("language", "N/A");

Expand Down Expand Up @@ -2365,8 +2368,11 @@ static int getFileInfo(QString inFile, QString outFile, int lenMethod)
stream.setAttribute("streamindex", i);
stream.setAttribute("ffmpegindex", ffmpegIndex++);
stream.setAttribute("codec", codec.trimmed());
if (strlen(st->language) > 0)
stream.setAttribute("language", st->language);

AVMetadataTag *metatag =
av_metadata_get(st->metadata, "language", NULL, 0);
if (metatag)
stream.setAttribute("language", metatag->value);
else
stream.setAttribute("language", "N/A");

Expand Down
2 changes: 1 addition & 1 deletion mythplugins/mythmusic/mythmusic/avfdecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ bool avfDecoder::initialize()
if (m_sampleFmt == FORMAT_NONE)
{
int bps =
av_get_bits_per_sample_format(m_audioDec->sample_fmt);
av_get_bits_per_sample_fmt(m_audioDec->sample_fmt);
if (m_audioDec->sample_fmt == SAMPLE_FMT_S32 &&
m_audioDec->bits_per_raw_sample)
{
Expand Down
31 changes: 23 additions & 8 deletions mythplugins/mythmusic/mythmusic/metaioavfcomment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,35 @@ Metadata* MetaIOAVFComment::read(QString filename)
if (av_find_stream_info(p_context) < 0)
return NULL;


title += (char *)p_context->title;
if (title.isEmpty())
AVMetadataTag *tag = av_metadata_get(p_context->metadata, "title", NULL, 0);
if (!tag)
{
readFromFilename(filename, artist, album, title, genre, tracknum);
}
else
{
artist += (char *)p_context->author;
title = (char *)tag->value;

tag = av_metadata_get(p_context->metadata, "author", NULL, 0);
if (tag)
artist += (char *)tag->value;

// compilation_artist???
album += (char *)p_context->album;
genre += (char *)p_context->genre;
year = p_context->year;
tracknum = p_context->track;
tag = av_metadata_get(p_context->metadata, "album", NULL, 0);
if (tag)
album += (char *)tag->value;

tag = av_metadata_get(p_context->metadata, "genre", NULL, 0);
if (tag)
genre += (char *)tag->value;

tag = av_metadata_get(p_context->metadata, "year", NULL, 0);
if (tag)
year = atoi(tag->value);

tag = av_metadata_get(p_context->metadata, "tracknum", NULL, 0);
if (tag)
tracknum = atoi(tag->value);
}

length = getTrackLength(p_context);
Expand Down

0 comments on commit b7b6b11

Please sign in to comment.