#include "ffmpeg_decoder.h"
#include "ffmpeg_audio_stream.h"
#include "ffmpeg_subtitle_stream.h"
-#include "filter_graph.h"
+#include "video_filter_graph.h"
#include "audio_buffers.h"
#include "ffmpeg_content.h"
#include "raw_image_proxy.h"
}
bool
-FFmpegDecoder::pass (PassReason reason)
+FFmpegDecoder::pass (PassReason reason, bool accurate)
{
int r = av_read_frame (_format_context, &_packet);
int const si = _packet.stream_index;
shared_ptr<const FFmpegContent> fc = _ffmpeg_content;
- if (si == _video_stream && !_ignore_video && reason != PASS_REASON_SUBTITLE) {
+ if (si == _video_stream && !_ignore_video && (accurate || reason != PASS_REASON_SUBTITLE)) {
decode_video_packet ();
} else if (fc->subtitle_stream() && fc->subtitle_stream()->uses_index (_format_context, si)) {
decode_subtitle_packet ();
- } else if (reason != PASS_REASON_SUBTITLE) {
+ } else if (accurate || reason != PASS_REASON_SUBTITLE) {
decode_audio_packet ();
}
boost::mutex::scoped_lock lm (_filter_graphs_mutex);
- shared_ptr<FilterGraph> graph;
+ shared_ptr<VideoFilterGraph> graph;
- list<shared_ptr<FilterGraph> >::iterator i = _filter_graphs.begin();
+ list<shared_ptr<VideoFilterGraph> >::iterator i = _filter_graphs.begin();
while (i != _filter_graphs.end() && !(*i)->can_process (dcp::Size (_frame->width, _frame->height), (AVPixelFormat) _frame->format)) {
++i;
}
if (i == _filter_graphs.end ()) {
- graph.reset (new FilterGraph (_ffmpeg_content, dcp::Size (_frame->width, _frame->height), (AVPixelFormat) _frame->format));
+ graph.reset (new VideoFilterGraph (dcp::Size (_frame->width, _frame->height), (AVPixelFormat) _frame->format));
+ graph->setup (_ffmpeg_content->filters ());
_filter_graphs.push_back (graph);
LOG_GENERAL (N_("New graph for %1x%2, pixel format %3"), _frame->width, _frame->height, _frame->format);
} else {