- if (av_buffersrc_write_frame (_buffer_src_context, frame) < 0) {
- throw DecodeError (N_("could not push buffer into filter chain."));
- }
-
- while (true) {
- if (av_buffersink_get_frame (_buffer_sink_context, _frame) < 0) {
- break;
+ if (_copy) {
+ images.push_back (make_pair (shared_ptr<Image> (new Image (frame)), av_frame_get_best_effort_timestamp (frame)));
+ } else {
+ 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));