#include "ffmpeg_audio_stream.h"
#include "ffmpeg_subtitle_stream.h"
#include "util.h"
+#include "safe_stringstream.h"
#include "i18n.h"
using std::string;
using std::cout;
using std::max;
-using std::stringstream;
using boost::shared_ptr;
using boost::optional;
* where we should look for subtitles (video and audio are always present,
* so they are ok).
*/
- while (1) {
+ while (true) {
int r = av_read_frame (_format_context, &_packet);
if (r < 0) {
break;
ContentTime
FFmpegExaminer::video_length () const
{
- ContentTime const length = ContentTime::from_seconds (double (_format_context->duration - _format_context->start_time) / AV_TIME_BASE);
- return ContentTime (max (int64_t (1), length.get ()));
+ ContentTime const length = ContentTime::from_seconds (double (_format_context->duration) / AV_TIME_BASE);
+ return ContentTime (max (ContentTime::Type (1), length.get ()));
}
string
FFmpegExaminer::audio_stream_name (AVStream* s) const
{
- stringstream n;
+ SafeStringStream n;
n << stream_name (s);
string
FFmpegExaminer::subtitle_stream_name (AVStream* s) const
{
- stringstream n;
+ SafeStringStream n;
n << stream_name (s);
string
FFmpegExaminer::stream_name (AVStream* s) const
{
- stringstream n;
+ SafeStringStream n;
if (s->metadata) {
AVDictionaryEntry const * lang = av_dict_get (s->metadata, "language", 0, 0);