Skip to content
Snippets Groups Projects
Commit 444e0f0c authored by Adrien Béraud's avatar Adrien Béraud
Browse files

media: avoid crash in case of unknown format

Change-Id: I72ea80c56c685545cfa2d185174db1a52da04eb6
parent e30887fa
Branches
No related tags found
No related merge requests found
......@@ -149,8 +149,9 @@ struct MediaStream {
inline std::ostream& operator<<(std::ostream& os, const MediaStream& ms)
{
if (ms.isVideo) {
auto formatName = av_get_pix_fmt_name(static_cast<AVPixelFormat>(ms.format));
os << (ms.name.empty() ? "(null)" : ms.name) << ": "
<< av_get_pix_fmt_name(static_cast<AVPixelFormat>(ms.format)) << " video, "
<< (formatName ? formatName : "(unknown format)") << " video, "
<< ms.width << "x" << ms.height << ", "
<< ms.frameRate << " fps (" << ms.timeBase << ")";
if (ms.bitrate > 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment