Commit 444e0f0c authored by Adrien Béraud's avatar Adrien Béraud

media: avoid crash in case of unknown format

Change-Id: I72ea80c56c685545cfa2d185174db1a52da04eb6
parent e30887fa
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment