aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Input/ffmpeg
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2019-01-03 07:41:04 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2019-01-03 07:41:04 +0000
commitb917024aa1ac4cb0a40164132db3c6d2913157eb (patch)
tree4424bef9f2ac9a3dab21c822836a1b5c79ffee47 /src/plugins/Input/ffmpeg
parentbef5a901922c002815d047d276e61ec0bf8c0f46 (diff)
downloadqmmp-b917024aa1ac4cb0a40164132db3c6d2913157eb.tar.gz
qmmp-b917024aa1ac4cb0a40164132db3c6d2913157eb.tar.bz2
qmmp-b917024aa1ac4cb0a40164132db3c6d2913157eb.zip
fixed build with -Werror=zero-as-null-pointer-constant
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@8572 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input/ffmpeg')
-rw-r--r--src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp56
-rw-r--r--src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp36
-rw-r--r--src/plugins/Input/ffmpeg/ffmpegmetadatamodel.cpp12
-rw-r--r--src/plugins/Input/ffmpeg/replaygainreader.cpp2
-rw-r--r--src/plugins/Input/ffmpeg/settingsdialog.h2
5 files changed, 54 insertions, 54 deletions
diff --git a/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp b/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp
index 99ff7c402..9548970fa 100644
--- a/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp
+++ b/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp
@@ -71,17 +71,17 @@ DecoderFFmpeg::DecoderFFmpeg(const QString &path, QIODevice *i)
{
m_bitrate = 0;
m_totalTime = 0;
- ic = 0;
+ ic = nullptr;
m_path = path;
m_temp_pkt.size = 0;
m_pkt.size = 0;
- m_pkt.data = 0;
+ m_pkt.data = nullptr;
m_output_at = 0;
m_skipBytes = 0;
- m_stream = 0;
- m_decoded_frame = 0;
+ m_stream = nullptr;
+ m_decoded_frame = nullptr;
m_channels = 0;
- c = 0;
+ c = nullptr;
audioIndex = 0;
m_seekTime = -1;
av_init_packet(&m_pkt);
@@ -145,7 +145,7 @@ bool DecoderFFmpeg::initialize()
qDebug("DecoderFFmpeg: detected format: %s", fmt->long_name);
qDebug("=%s=", fmt->name);
- m_stream = avio_alloc_context(m_input_buf, INPUT_BUFFER_SIZE, 0, this, ffmpeg_read, NULL, ffmpeg_seek);
+ m_stream = avio_alloc_context(m_input_buf, INPUT_BUFFER_SIZE, 0, this, ffmpeg_read, nullptr, ffmpeg_seek);
if(!m_stream)
{
qWarning("DecoderFFmpeg: unable to initialize I/O callbacks");
@@ -155,37 +155,37 @@ bool DecoderFFmpeg::initialize()
m_stream->max_packet_size = INPUT_BUFFER_SIZE;
ic->pb = m_stream;
- if(avformat_open_input(&ic, 0, fmt, 0) != 0)
+ if(avformat_open_input(&ic, nullptr, fmt, nullptr) != 0)
{
qDebug("DecoderFFmpeg: avformat_open_input() failed");
return false;
}
- avformat_find_stream_info(ic, 0);
+ avformat_find_stream_info(ic, nullptr);
if(ic->pb)
ic->pb->eof_reached = 0;
if (input()->isSequential())
{
QMap<Qmmp::MetaData, QString> metaData;
- AVDictionaryEntry *album = av_dict_get(ic->metadata,"album",0,0);
+ AVDictionaryEntry *album = av_dict_get(ic->metadata,"album",nullptr,0);
if(!album)
- album = av_dict_get(ic->metadata,"WM/AlbumTitle",0,0);
- AVDictionaryEntry *artist = av_dict_get(ic->metadata,"artist",0,0);
+ album = av_dict_get(ic->metadata,"WM/AlbumTitle",nullptr,0);
+ AVDictionaryEntry *artist = av_dict_get(ic->metadata,"artist",nullptr,0);
if(!artist)
- artist = av_dict_get(ic->metadata,"author",0,0);
- AVDictionaryEntry *comment = av_dict_get(ic->metadata,"comment",0,0);
- AVDictionaryEntry *genre = av_dict_get(ic->metadata,"genre",0,0);
- AVDictionaryEntry *title = av_dict_get(ic->metadata,"title",0,0);
- AVDictionaryEntry *year = av_dict_get(ic->metadata,"WM/Year",0,0);
+ artist = av_dict_get(ic->metadata,"author",nullptr,0);
+ AVDictionaryEntry *comment = av_dict_get(ic->metadata,"comment",nullptr,0);
+ AVDictionaryEntry *genre = av_dict_get(ic->metadata,"genre",nullptr,0);
+ AVDictionaryEntry *title = av_dict_get(ic->metadata,"title",nullptr,0);
+ AVDictionaryEntry *year = av_dict_get(ic->metadata,"WM/Year",nullptr,0);
if(!year)
- year = av_dict_get(ic->metadata,"year",0,0);
+ year = av_dict_get(ic->metadata,"year",nullptr,0);
if(!year)
- year = av_dict_get(ic->metadata,"date",0,0);
- AVDictionaryEntry *track = av_dict_get(ic->metadata,"track",0,0);
+ year = av_dict_get(ic->metadata,"date",nullptr,0);
+ AVDictionaryEntry *track = av_dict_get(ic->metadata,"track",nullptr,0);
if(!track)
- track = av_dict_get(ic->metadata,"WM/Track",0,0);
+ track = av_dict_get(ic->metadata,"WM/Track",nullptr,0);
if(!track)
- track = av_dict_get(ic->metadata,"WM/TrackNumber",0,0);
+ track = av_dict_get(ic->metadata,"WM/TrackNumber",nullptr,0);
if(album)
metaData.insert(Qmmp::ALBUM, QString::fromUtf8(album->value).trimmed());
@@ -209,12 +209,12 @@ bool DecoderFFmpeg::initialize()
setReplayGainInfo(rg.replayGainInfo());
#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57,4,0)) //ffmpeg-3.1: 57.48.101
- c = avcodec_alloc_context3(NULL);
+ c = avcodec_alloc_context3(nullptr);
#endif
ic->flags |= AVFMT_FLAG_GENPTS;
av_read_play(ic);
- audioIndex = av_find_best_stream(ic, AVMEDIA_TYPE_AUDIO, -1, -1, 0, 0);
+ audioIndex = av_find_best_stream(ic, AVMEDIA_TYPE_AUDIO, -1, -1, nullptr, 0);
if(audioIndex < 0)
{
qWarning("DecoderFFmpeg: unable to find audio stream");
@@ -246,7 +246,7 @@ bool DecoderFFmpeg::initialize()
m_channels = c->request_channels;
#endif
- av_dump_format(ic,0,0,0);
+ av_dump_format(ic,0,nullptr,0);
AVCodec *codec = avcodec_find_decoder(c->codec_id);
@@ -256,7 +256,7 @@ bool DecoderFFmpeg::initialize()
return false;
}
- if (avcodec_open2(c, codec, 0) < 0)
+ if (avcodec_open2(c, codec, nullptr) < 0)
{
qWarning("DecoderFFmpeg: error while opening codec for output stream");
return false;
@@ -393,7 +393,7 @@ qint64 DecoderFFmpeg::ffmpeg_decode()
#endif
if(got_frame)
- out_size = av_samples_get_buffer_size(0, c->channels, m_decoded_frame->nb_samples,
+ out_size = av_samples_get_buffer_size(nullptr, c->channels, m_decoded_frame->nb_samples,
c->sample_fmt, 1);
else
out_size = 0;
@@ -517,7 +517,7 @@ void DecoderFFmpeg::fillBuffer()
#else
av_free_packet(&m_pkt);
#endif
- m_pkt.data = 0;
+ m_pkt.data = nullptr;
m_temp_pkt.size = 0;
break;
}
@@ -531,7 +531,7 @@ void DecoderFFmpeg::fillBuffer()
#else
av_free_packet(&m_pkt);
#endif
- m_pkt.data = 0;
+ m_pkt.data = nullptr;
m_temp_pkt.size = 0;
continue;
}
diff --git a/src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp b/src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp
index f10186c69..abca4bfb6 100644
--- a/src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp
+++ b/src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp
@@ -165,12 +165,12 @@ QList<TrackInfo *> DecoderFFmpegFactory::createPlayList(const QString &path, Tra
if(parts == TrackInfo::NoParts)
return QList<TrackInfo*>() << info;
- AVFormatContext *in = 0;
+ AVFormatContext *in = nullptr;
#ifdef Q_OS_WIN
- if(avformat_open_input(&in, path.toUtf8().constData(), 0, 0) < 0)
+ if(avformat_open_input(&in, path.toUtf8().constData(), nullptr, nullptr) < 0)
#else
- if(avformat_open_input(&in, path.toLocal8Bit().constData(), 0, 0) < 0)
+ if(avformat_open_input(&in, path.toLocal8Bit().constData(), nullptr, nullptr) < 0)
#endif
{
qDebug("DecoderFFmpegFactory: unable to open file");
@@ -178,29 +178,29 @@ QList<TrackInfo *> DecoderFFmpegFactory::createPlayList(const QString &path, Tra
return QList<TrackInfo*>();
}
- avformat_find_stream_info(in, 0);
+ avformat_find_stream_info(in, nullptr);
if(parts & TrackInfo::MetaData)
{
- AVDictionaryEntry *album = av_dict_get(in->metadata,"album",0,0);
+ AVDictionaryEntry *album = av_dict_get(in->metadata,"album",nullptr,0);
if(!album)
- album = av_dict_get(in->metadata,"WM/AlbumTitle",0,0);
- AVDictionaryEntry *artist = av_dict_get(in->metadata,"artist",0,0);
+ album = av_dict_get(in->metadata,"WM/AlbumTitle",nullptr,0);
+ AVDictionaryEntry *artist = av_dict_get(in->metadata,"artist",nullptr,0);
if(!artist)
- artist = av_dict_get(in->metadata,"author",0,0);
- AVDictionaryEntry *comment = av_dict_get(in->metadata,"comment",0,0);
- AVDictionaryEntry *genre = av_dict_get(in->metadata,"genre",0,0);
- AVDictionaryEntry *title = av_dict_get(in->metadata,"title",0,0);
- AVDictionaryEntry *year = av_dict_get(in->metadata,"WM/Year",0,0);
+ artist = av_dict_get(in->metadata,"author",nullptr,0);
+ AVDictionaryEntry *comment = av_dict_get(in->metadata,"comment",nullptr,0);
+ AVDictionaryEntry *genre = av_dict_get(in->metadata,"genre",nullptr,0);
+ AVDictionaryEntry *title = av_dict_get(in->metadata,"title",nullptr,0);
+ AVDictionaryEntry *year = av_dict_get(in->metadata,"WM/Year",nullptr,0);
if(!year)
- year = av_dict_get(in->metadata,"year",0,0);
+ year = av_dict_get(in->metadata,"year",nullptr,0);
if(!year)
- year = av_dict_get(in->metadata,"date",0,0);
- AVDictionaryEntry *track = av_dict_get(in->metadata,"track",0,0);
+ year = av_dict_get(in->metadata,"date",nullptr,0);
+ AVDictionaryEntry *track = av_dict_get(in->metadata,"track",nullptr,0);
if(!track)
- track = av_dict_get(in->metadata,"WM/Track",0,0);
+ track = av_dict_get(in->metadata,"WM/Track",nullptr,0);
if(!track)
- track = av_dict_get(in->metadata,"WM/TrackNumber",0,0);
+ track = av_dict_get(in->metadata,"WM/TrackNumber",nullptr,0);
if(album)
info->setValue(Qmmp::ALBUM, QString::fromUtf8(album->value));
@@ -220,7 +220,7 @@ QList<TrackInfo *> DecoderFFmpegFactory::createPlayList(const QString &path, Tra
if(parts & TrackInfo::Properties)
{
- int idx = av_find_best_stream(in, AVMEDIA_TYPE_AUDIO, -1, -1, 0, 0);
+ int idx = av_find_best_stream(in, AVMEDIA_TYPE_AUDIO, -1, -1, nullptr, 0);
if(idx >= 0)
{
#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57,48,0)) //ffmpeg-3.1: 57.48.101
diff --git a/src/plugins/Input/ffmpeg/ffmpegmetadatamodel.cpp b/src/plugins/Input/ffmpeg/ffmpegmetadatamodel.cpp
index d3b725744..17907d0cd 100644
--- a/src/plugins/Input/ffmpeg/ffmpegmetadatamodel.cpp
+++ b/src/plugins/Input/ffmpeg/ffmpegmetadatamodel.cpp
@@ -23,14 +23,14 @@
FFmpegMetaDataModel::FFmpegMetaDataModel(const QString &path) : MetaDataModel(true)
{
- m_in = 0;
+ m_in = nullptr;
#ifdef Q_OS_WIN
- if (avformat_open_input(&m_in, path.toUtf8().constData(), 0, 0) < 0)
+ if (avformat_open_input(&m_in, path.toUtf8().constData(), nullptr, nullptr) < 0)
#else
- if (avformat_open_input(&m_in, path.toLocal8Bit().constData(), 0, 0) < 0)
+ if (avformat_open_input(&m_in, path.toLocal8Bit().constData(), nullptr, nullptr) < 0)
#endif
return;
- avformat_find_stream_info(m_in, 0);
+ avformat_find_stream_info(m_in, nullptr);
av_read_play(m_in);
}
@@ -45,9 +45,9 @@ QPixmap FFmpegMetaDataModel::cover() const
if(!m_in)
return QPixmap();
#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57,48,0)) //ffmpeg-3.1: 57.48.101
- AVCodecParameters *c = 0;
+ AVCodecParameters *c = nullptr;
#else
- AVCodecContext *c = 0;
+ AVCodecContext *c = nullptr;
#endif
for (uint idx = 0; idx < m_in->nb_streams; idx++)
diff --git a/src/plugins/Input/ffmpeg/replaygainreader.cpp b/src/plugins/Input/ffmpeg/replaygainreader.cpp
index 13c796614..3d4a11d22 100644
--- a/src/plugins/Input/ffmpeg/replaygainreader.cpp
+++ b/src/plugins/Input/ffmpeg/replaygainreader.cpp
@@ -22,7 +22,7 @@
ReplayGainReader::ReplayGainReader(AVFormatContext *ic)
{
- AVDictionaryEntry *t = 0;
+ AVDictionaryEntry *t = nullptr;
while((t = av_dict_get(ic->metadata, "", t, AV_DICT_IGNORE_SUFFIX)))
{
if(!strcmp(t->key, "replaygain_album_gain"))
diff --git a/src/plugins/Input/ffmpeg/settingsdialog.h b/src/plugins/Input/ffmpeg/settingsdialog.h
index be1bbf22b..599c3481e 100644
--- a/src/plugins/Input/ffmpeg/settingsdialog.h
+++ b/src/plugins/Input/ffmpeg/settingsdialog.h
@@ -31,7 +31,7 @@ class SettingsDialog : public QDialog
{
Q_OBJECT
public:
- SettingsDialog(QWidget *parent = 0);
+ SettingsDialog(QWidget *parent = nullptr);
~SettingsDialog();