Replace nullptr with NULL.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/8/head
Michele Calgaro 3 years ago
parent 095c3186b1
commit e24ff5c0cf
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -74,7 +74,7 @@ extern "C" {
// [wmav2 @ 0xxxxx] Multiple frames in a packet. // [wmav2 @ 0xxxxx] Multiple frames in a packet.
// [wmav2 @ 0xxxxx] Got unexpected packet size after a partial decode // [wmav2 @ 0xxxxx] Got unexpected packet size after a partial decode
K3bFFMpegWrapper *K3bFFMpegWrapper::s_instance = nullptr; K3bFFMpegWrapper *K3bFFMpegWrapper::s_instance = NULL;
class K3bFFMpegFile::Private { class K3bFFMpegFile::Private {
public: public:
@ -88,7 +88,7 @@ public:
::AVFrame *frame; ::AVFrame *frame;
::AVPacket packet; ::AVPacket packet;
char *outputBufferPos = nullptr; char *outputBufferPos = NULL;
int outputBufferSize; int outputBufferSize;
int packetSize; int packetSize;
bool isSpacious; bool isSpacious;
@ -96,9 +96,9 @@ public:
K3bFFMpegFile::K3bFFMpegFile(const TQString &filename) : m_filename(filename) { K3bFFMpegFile::K3bFFMpegFile(const TQString &filename) : m_filename(filename) {
d = new Private; d = new Private;
d->formatContext = nullptr; d->formatContext = NULL;
d->codec = nullptr; d->codec = NULL;
d->audio_stream = nullptr; d->audio_stream = NULL;
d->frame = av_frame_alloc(); d->frame = av_frame_alloc();
} }
@ -113,7 +113,7 @@ bool K3bFFMpegFile::open() {
// open the file // open the file
int err = ::avformat_open_input(&d->formatContext, m_filename.local8Bit(), int err = ::avformat_open_input(&d->formatContext, m_filename.local8Bit(),
nullptr, nullptr); NULL, NULL);
if (err < 0) { if (err < 0) {
kdDebug() << "(K3bFFMpegFile) unable to open " << m_filename kdDebug() << "(K3bFFMpegFile) unable to open " << m_filename
<< " with error " << err; << " with error " << err;
@ -121,7 +121,7 @@ bool K3bFFMpegFile::open() {
} }
// analyze the streams // analyze the streams
::avformat_find_stream_info(d->formatContext, nullptr); ::avformat_find_stream_info(d->formatContext, NULL);
// we only handle files containing one audio stream // we only handle files containing one audio stream
for (uint i = 0; i < d->formatContext->nb_streams; ++i) { for (uint i = 0; i < d->formatContext->nb_streams; ++i) {
@ -130,7 +130,7 @@ bool K3bFFMpegFile::open() {
if (!d->audio_stream) { if (!d->audio_stream) {
d->audio_stream = d->formatContext->streams[i]; d->audio_stream = d->formatContext->streams[i];
} else { } else {
d->audio_stream = nullptr; d->audio_stream = NULL;
kdDebug() << "(K3bFFMpegFile) more than one audio stream in " kdDebug() << "(K3bFFMpegFile) more than one audio stream in "
<< m_filename; << m_filename;
return false; return false;
@ -154,7 +154,7 @@ bool K3bFFMpegFile::open() {
// open the codec on our context // open the codec on our context
kdDebug() << "(K3bFFMpegFile) found codec for " << m_filename; kdDebug() << "(K3bFFMpegFile) found codec for " << m_filename;
if (::avcodec_open2(codecContext, d->codec, nullptr) < 0) { if (::avcodec_open2(codecContext, d->codec, NULL) < 0) {
kdDebug() << "(K3bFFMpegDecoderFactory) could not open codec."; kdDebug() << "(K3bFFMpegDecoderFactory) could not open codec.";
return false; return false;
} }
@ -182,19 +182,19 @@ bool K3bFFMpegFile::open() {
void K3bFFMpegFile::close() { void K3bFFMpegFile::close() {
d->outputBufferSize = 0; d->outputBufferSize = 0;
d->packetSize = 0; d->packetSize = 0;
d->packetData = nullptr; d->packetData = NULL;
if (d->codec) { if (d->codec) {
::avcodec_close(FFMPEG_CODEC(d->audio_stream)); ::avcodec_close(FFMPEG_CODEC(d->audio_stream));
d->codec = nullptr; d->codec = NULL;
} }
if (d->formatContext) { if (d->formatContext) {
::avformat_close_input(&d->formatContext); ::avformat_close_input(&d->formatContext);
d->formatContext = nullptr; d->formatContext = NULL;
} }
d->audio_stream = nullptr; d->audio_stream = NULL;
} }
K3b::Msf K3bFFMpegFile::length() const { return d->length; } K3b::Msf K3bFFMpegFile::length() const { return d->length; }
@ -229,7 +229,7 @@ TQString K3bFFMpegFile::typeComment() const {
TQString K3bFFMpegFile::title() const { TQString K3bFFMpegFile::title() const {
// FIXME: is this UTF8 or something?? // FIXME: is this UTF8 or something??
AVDictionaryEntry *ade = AVDictionaryEntry *ade =
av_dict_get(d->formatContext->metadata, "TITLE", nullptr, 0); av_dict_get(d->formatContext->metadata, "TITLE", NULL, 0);
return ade && ade->value && ade->value[0] != '\0' return ade && ade->value && ade->value[0] != '\0'
? TQString::fromLocal8Bit(ade->value) ? TQString::fromLocal8Bit(ade->value)
: TQString(); : TQString();
@ -238,7 +238,7 @@ TQString K3bFFMpegFile::title() const {
TQString K3bFFMpegFile::author() const { TQString K3bFFMpegFile::author() const {
// FIXME: is this UTF8 or something?? // FIXME: is this UTF8 or something??
AVDictionaryEntry *ade = AVDictionaryEntry *ade =
av_dict_get(d->formatContext->metadata, "ARTIST", nullptr, 0); av_dict_get(d->formatContext->metadata, "ARTIST", NULL, 0);
return ade && ade->value && ade->value[0] != '\0' return ade && ade->value && ade->value[0] != '\0'
? TQString::fromLocal8Bit(ade->value) ? TQString::fromLocal8Bit(ade->value)
: TQString(); : TQString();
@ -247,7 +247,7 @@ TQString K3bFFMpegFile::author() const {
TQString K3bFFMpegFile::comment() const { TQString K3bFFMpegFile::comment() const {
// FIXME: is this UTF8 or something?? // FIXME: is this UTF8 or something??
AVDictionaryEntry *ade = AVDictionaryEntry *ade =
av_dict_get(d->formatContext->metadata, "COMMENT", nullptr, 0); av_dict_get(d->formatContext->metadata, "COMMENT", NULL, 0);
return ade && ade->value && ade->value[0] != '\0' return ade && ade->value && ade->value[0] != '\0'
? TQString::fromLocal8Bit(ade->value) ? TQString::fromLocal8Bit(ade->value)
: TQString(); : TQString();
@ -366,7 +366,7 @@ bool K3bFFMpegFile::seek(const K3b::Msf &msf) {
// av_register_all is deprecated since ffmpeg 4.0, can be dropped // av_register_all is deprecated since ffmpeg 4.0, can be dropped
K3bFFMpegWrapper::K3bFFMpegWrapper() { ::av_register_all(); } K3bFFMpegWrapper::K3bFFMpegWrapper() { ::av_register_all(); }
K3bFFMpegWrapper::~K3bFFMpegWrapper() { s_instance = nullptr; } K3bFFMpegWrapper::~K3bFFMpegWrapper() { s_instance = NULL; }
K3bFFMpegWrapper *K3bFFMpegWrapper::instance() { K3bFFMpegWrapper *K3bFFMpegWrapper::instance() {
if (!s_instance) { if (!s_instance) {
@ -393,5 +393,5 @@ K3bFFMpegFile *K3bFFMpegWrapper::open(const TQString &filename) const {
} }
delete file; delete file;
return nullptr; return NULL;
} }

Loading…
Cancel
Save