#include "i18n.h"
using std::string;
+using std::cout;
using std::stringstream;
using boost::shared_ptr;
_just_sought = true;
+ if (frame == 0) {
+ /* We're already there; from here on we can only seek non-zero amounts */
+ return;
+ }
+
if (accurate) {
while (1) {
int r = av_read_frame (_format_context, &_packet);
if (avcodec_decode_video2 (video_codec_context(), _frame, &frame_finished, &_packet) < 0 || !frame_finished) {
return false;
}
-
+
boost::mutex::scoped_lock lm (_filter_graphs_mutex);
shared_ptr<FilterGraph> graph;
int frame_finished;
avcodec_get_frame_defaults (_frame);
- cout << "got packet " << _packet.stream_index << "\n";
-
AVCodecContext* context = _format_context->streams[_packet.stream_index]->codec;
if (_packet.stream_index == _video_stream && !_first_video) {
++i;
}
+ av_free_packet (&_packet);
+
if (_first_video && have_all_audio) {
break;
}
-
- av_free_packet (&_packet);
}
}
}
#ifdef DEBUG_PLAYER
- cout << "= PASS " << this << "\n";
+ cout << "= PASS\n";
#endif
Time earliest_t = TIME_MAX;
_player->Changed.connect (boost::bind (&FilmViewer::player_changed, this));
calculate_sizes ();
- fetch_current_frame_again ();
}
void
double const fps = _film->dcp_video_frame_rate ();
/* Count frame number from 1 ... not sure if this is the best idea */
_frame_number->SetLabel (wxString::Format (wxT("%d"), int (rint (t * fps / TIME_HZ)) + 1));
-
+
double w = static_cast<double>(t) / TIME_HZ;
int const h = (w / 3600);
w -= h * 3600;