#include "exceptions.h"
#include "image.h"
#include "ffmpeg_content.h"
+#include "safe_stringstream.h"
#include "i18n.h"
-using std::stringstream;
using std::string;
using std::list;
using std::pair;
throw DecodeError (N_("Could not create buffer sink filter"));
}
- stringstream a;
+ SafeStringStream a;
a << "video_size=" << _size.width << "x" << _size.height << ":"
<< "pix_fmt=" << _pixel_format << ":"
<< "time_base=1/1:"
inputs->pad_idx = 0;
inputs->next = 0;
- if (avfilter_graph_parse (graph, filters.c_str(), &inputs, &outputs, 0) < 0) {
+ if (avfilter_graph_parse (graph, filters.c_str(), inputs, outputs, 0) < 0) {
throw DecodeError (N_("could not set up filter graph."));
}
if (avfilter_graph_config (graph, 0) < 0) {
throw DecodeError (N_("could not configure filter graph."));
}
-
- avfilter_inout_free (&inputs);
- avfilter_inout_free (&outputs);
}
FilterGraph::~FilterGraph ()
if (_copy) {
images.push_back (make_pair (shared_ptr<Image> (new Image (frame)), av_frame_get_best_effort_timestamp (frame)));
} else {
- if (av_buffersrc_write_frame (_buffer_src_context, frame) < 0) {
- throw DecodeError (N_("could not push buffer into filter chain."));
+ int r = av_buffersrc_write_frame (_buffer_src_context, frame);
+ if (r < 0) {
+ throw DecodeError (String::compose (N_("could not push buffer into filter chain (%1)."), r));
}
while (true) {