Skip to content

Commit

Permalink
Fix fileinfo.xml generation in mytharchivehelper
Browse files Browse the repository at this point in the history
Plugin mytharchive:
When ffmpeg cannot determine the codec of the provided stream,
the whole buffer provided by `avcodec_string` is taken in the function
`getFileInfo` to create an xml entry. Cleanup this buffer by removing
'\0' characters. Otherwise, the return codec in the xml sequence will
hold 256 zeros and mythburn.py fails to read this xml file.

Refs #609
  • Loading branch information
rcrdnalor committed Jul 25, 2022
1 parent 109b934 commit 99a6e07
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -1967,7 +1967,7 @@ static int getFileInfo(const QString& inFile, const QString& outFile, int lenMet
#else
QStringList param = QString::fromStdString(buf).split(',', Qt::SkipEmptyParts);
#endif
QString codec = param[0].remove("Video:", Qt::CaseInsensitive);
QString codec = param[0].remove("Video:", Qt::CaseInsensitive).remove(QChar::Null);
QDomElement stream = doc.createElement("video");
stream.setAttribute("streamindex", i);
stream.setAttribute("ffmpegindex", ffmpegIndex++);
Expand Down Expand Up @@ -2098,7 +2098,7 @@ static int getFileInfo(const QString& inFile, const QString& outFile, int lenMet
#else
QStringList param = QString::fromStdString(buf).split(',', Qt::SkipEmptyParts);
#endif
QString codec = param[0].remove("Audio:", Qt::CaseInsensitive);
QString codec = param[0].remove("Audio:", Qt::CaseInsensitive).remove(QChar::Null);

QDomElement stream = doc.createElement("audio");
stream.setAttribute("streamindex", i);
Expand Down Expand Up @@ -2172,7 +2172,7 @@ static int getFileInfo(const QString& inFile, const QString& outFile, int lenMet
{
QDomElement stream = doc.createElement("data");
stream.setAttribute("streamindex", i);
stream.setAttribute("codec", QString::fromStdString(buf));
stream.setAttribute("codec", QString::fromStdString(buf).remove(QChar::Null));
streams.appendChild(stream);

break;
Expand Down

1 comment on commit 99a6e07

@bshanteau
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rcrdnalor Nov 3 mythtv v32 update does not include the commit. Ok if I volunteer to apply it?

Please sign in to comment.