using std::string;
using std::cout;
+using std::max;
using std::stringstream;
using boost::shared_ptr;
using boost::optional;
FFmpegExaminer::FFmpegExaminer (shared_ptr<const FFmpegContent> c)
- : FFmpeg (c)
+ : FFmpeg (c, true)
{
/* Find audio and subtitle streams */
VideoContent::Frame
FFmpegExaminer::video_length () const
{
- return (double (_format_context->duration) / AV_TIME_BASE) * video_frame_rate();
+ VideoContent::Frame const length = (double (_format_context->duration) / AV_TIME_BASE) * video_frame_rate();
+ return max (1, length);
}
string
}
}
- if (n.str().empty()) {
- n << "unknown";
+ if (!n.str().empty()) {
+ n << "; ";
}
+ n << s->codec->channels << " channels";
+
return n.str ();
}