Skip to content

Commit

Permalink
Merge branch 'devel/ffmpeg-sync-20120331'
Browse files Browse the repository at this point in the history
Conflicts:
	mythtv/libs/libmythtv/mythraopconnection.cpp
	mythtv/libs/libmythtv/mythraopconnection.h
	mythtv/libs/libmythtv/streamingringbuffer.cpp
  • Loading branch information
Beirdo committed May 8, 2012
2 parents 3f6ae11 + a17a6c1 commit 098c103
Show file tree
Hide file tree
Showing 2,574 changed files with 317,007 additions and 142,943 deletions.
17 changes: 8 additions & 9 deletions mythplugins/mytharchive/mytharchive/thumbfinder.cpp
Expand Up @@ -564,8 +564,7 @@ bool ThumbFinder::initAVCodec(const QString &inFile)

QByteArray inFileBA = inFile.toLocal8Bit();

int ret = av_open_input_file(
&m_inputFC, inFileBA.constData(), NULL, 0, NULL);
int ret = avformat_open_input(&m_inputFC, inFileBA.constData(), NULL, NULL);

if (ret)
{
Expand All @@ -574,11 +573,11 @@ bool ThumbFinder::initAVCodec(const QString &inFile)
}

// Getting stream information
if ((ret = av_find_stream_info(m_inputFC)) < 0)
if ((ret = avformat_find_stream_info(m_inputFC, NULL)) < 0)
{
LOG(VB_GENERAL, LOG_ERR,
QString("Couldn't get stream info, error #%1").arg(ret));
av_close_input_file(m_inputFC);
avformat_close_input(&m_inputFC);
m_inputFC = NULL;
return false;
}
Expand All @@ -591,7 +590,7 @@ bool ThumbFinder::initAVCodec(const QString &inFile)
for (uint i = 0; i < m_inputFC->nb_streams; i++)
{
AVStream *st = m_inputFC->streams[i];
if (m_inputFC->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO)
if (m_inputFC->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO)
{
m_startTime = -1;
if (m_inputFC->streams[i]->start_time != (int) AV_NOPTS_VALUE)
Expand Down Expand Up @@ -630,7 +629,7 @@ bool ThumbFinder::initAVCodec(const QString &inFile)
m_codecCtx->skip_frame = AVDISCARD_DEFAULT;
m_codecCtx->skip_idct = AVDISCARD_DEFAULT;
m_codecCtx->skip_loop_filter = AVDISCARD_DEFAULT;
m_codecCtx->error_recognition = FF_ER_CAREFUL;
m_codecCtx->err_recognition = AV_EF_CAREFUL;
m_codecCtx->error_concealment = 3;

// get decoder for video stream
Expand All @@ -644,7 +643,7 @@ bool ThumbFinder::initAVCodec(const QString &inFile)
}

// open codec
if (avcodec_open(m_codecCtx, m_codec) < 0)
if (avcodec_open2(m_codecCtx, m_codec, NULL) < 0)
{
LOG(VB_GENERAL, LOG_ERR,
"ThumbFinder: Couldn't open codec for video stream");
Expand Down Expand Up @@ -839,7 +838,7 @@ bool ThumbFinder::getFrameImage(bool needKeyFrame, int64_t requiredPTS)
{
frameCount++;

keyFrame = pkt.flags & PKT_FLAG_KEY;
keyFrame = pkt.flags & AV_PKT_FLAG_KEY;

if (m_startPTS == -1 && pkt.dts != (int64_t)AV_NOPTS_VALUE)
{
Expand Down Expand Up @@ -923,7 +922,7 @@ void ThumbFinder::closeAVCodec()
avcodec_close(m_codecCtx);

// close the video file
av_close_input_file(m_inputFC);
avformat_close_input(&m_inputFC);
}

void ThumbFinder::showMenu()
Expand Down
36 changes: 18 additions & 18 deletions mythplugins/mytharchive/mytharchivehelper/main.cpp
Expand Up @@ -1849,7 +1849,7 @@ static int grabThumbnail(QString inFile, QString thumbList, QString outFile, int

QByteArray inFileBA = inFile.toLocal8Bit();

int ret = av_open_input_file(&inputFC, inFileBA.constData(), NULL, 0, NULL);
int ret = avformat_open_input(&inputFC, inFileBA.constData(), NULL, NULL);
if (ret)
{
LOG(VB_JOBQUEUE, LOG_ERR, "grabThumbnail(): Couldn't open input file" +
Expand All @@ -1858,11 +1858,11 @@ static int grabThumbnail(QString inFile, QString thumbList, QString outFile, int
}

// Getting stream information
if ((ret = av_find_stream_info(inputFC)) < 0)
if ((ret = avformat_find_stream_info(inputFC, NULL)) < 0)
{
LOG(VB_JOBQUEUE, LOG_ERR,
QString("Couldn't get stream info, error #%1").arg(ret));
av_close_input_file(inputFC);
avformat_close_input(&inputFC);
inputFC = NULL;
return 1;
}
Expand All @@ -1874,7 +1874,7 @@ static int grabThumbnail(QString inFile, QString thumbList, QString outFile, int
for (uint i = 0; i < inputFC->nb_streams; i++)
{
AVStream *st = inputFC->streams[i];
if (inputFC->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO)
if (inputFC->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO)
{
videostream = i;
width = st->codec->width;
Expand Down Expand Up @@ -1906,7 +1906,7 @@ static int grabThumbnail(QString inFile, QString thumbList, QString outFile, int
}

// open codec
if (avcodec_open(codecCtx, codec) < 0)
if (avcodec_open2(codecCtx, codec, NULL) < 0)
{
LOG(VB_JOBQUEUE, LOG_ERR, "Couldn't open codec for video stream");
return 1;
Expand Down Expand Up @@ -2036,7 +2036,7 @@ static int grabThumbnail(QString inFile, QString thumbList, QString outFile, int
avcodec_close(codecCtx);

// close the video file
av_close_input_file(inputFC);
avformat_close_input(&inputFC);

return 0;
}
Expand Down Expand Up @@ -2195,7 +2195,7 @@ static int getFileInfo(QString inFile, QString outFile, int lenMethod)

QByteArray inFileBA = inFile.toLocal8Bit();

int ret = av_open_input_file(&inputFC, inFileBA.constData(), fmt, 0, NULL);
int ret = avformat_open_input(&inputFC, inFileBA.constData(), fmt, NULL);

if (ret)
{
Expand All @@ -2205,13 +2205,13 @@ static int getFileInfo(QString inFile, QString outFile, int lenMethod)
}

// Getting stream information
ret = av_find_stream_info(inputFC);
ret = avformat_find_stream_info(inputFC, NULL);

if (ret < 0)
{
LOG(VB_JOBQUEUE, LOG_ERR,
QString("Couldn't get stream info, error #%1").arg(ret));
av_close_input_file(inputFC);
avformat_close_input(&inputFC);
inputFC = NULL;
return 1;
}
Expand Down Expand Up @@ -2244,7 +2244,7 @@ static int getFileInfo(QString inFile, QString outFile, int lenMethod)

switch (inputFC->streams[i]->codec->codec_type)
{
case CODEC_TYPE_VIDEO:
case AVMEDIA_TYPE_VIDEO:
{
QStringList param = QString(buf).split(',', QString::SkipEmptyParts);
QString codec = param[0].remove("Video:", Qt::CaseInsensitive);
Expand Down Expand Up @@ -2358,7 +2358,7 @@ static int getFileInfo(QString inFile, QString outFile, int lenMethod)
break;
}

case CODEC_TYPE_AUDIO:
case AVMEDIA_TYPE_AUDIO:
{
QStringList param = QString(buf).split(',', QString::SkipEmptyParts);
QString codec = param[0].remove("Audio:", Qt::CaseInsensitive);
Expand All @@ -2376,8 +2376,8 @@ static int getFileInfo(QString inFile, QString outFile, int lenMethod)

stream.setAttribute("channels", st->codec->channels);

AVMetadataTag *metatag =
av_metadata_get(st->metadata, "language", NULL, 0);
AVDictionaryEntry *metatag =
av_dict_get(st->metadata, "language", NULL, 0);
if (metatag)
stream.setAttribute("language", metatag->value);
else
Expand All @@ -2404,7 +2404,7 @@ static int getFileInfo(QString inFile, QString outFile, int lenMethod)
break;
}

case CODEC_TYPE_SUBTITLE:
case AVMEDIA_TYPE_SUBTITLE:
{
QStringList param = QString(buf).split(',', QString::SkipEmptyParts);
QString codec = param[0].remove("Subtitle:", Qt::CaseInsensitive);
Expand All @@ -2414,8 +2414,8 @@ static int getFileInfo(QString inFile, QString outFile, int lenMethod)
stream.setAttribute("ffmpegindex", ffmpegIndex++);
stream.setAttribute("codec", codec.trimmed());

AVMetadataTag *metatag =
av_metadata_get(st->metadata, "language", NULL, 0);
AVDictionaryEntry *metatag =
av_dict_get(st->metadata, "language", NULL, 0);
if (metatag)
stream.setAttribute("language", metatag->value);
else
Expand All @@ -2428,7 +2428,7 @@ static int getFileInfo(QString inFile, QString outFile, int lenMethod)
break;
}

case CODEC_TYPE_DATA:
case AVMEDIA_TYPE_DATA:
{
QDomElement stream = doc.createElement("data");
stream.setAttribute("streamindex", i);
Expand Down Expand Up @@ -2460,7 +2460,7 @@ static int getFileInfo(QString inFile, QString outFile, int lenMethod)
f.close();

// Close input file
av_close_input_file(inputFC);
avformat_close_input(&inputFC);
inputFC = NULL;

return 0;
Expand Down

0 comments on commit 098c103

Please sign in to comment.