From cdae0a8bd3f1218e10fc2947e3d9db0abf896950 Mon Sep 17 00:00:00 2001 From: focus Date: Wed, 9 Feb 2011 13:52:30 +0000 Subject: [PATCH] Testing foreign ts+xml recording playback, new libcs and libnxp needed git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1133 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- lib/libcoolstream/playback_cs.h | 2 +- src/gui/movieplayer.cpp | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/libcoolstream/playback_cs.h b/lib/libcoolstream/playback_cs.h index bfd6e13e4..fc8bad063 100644 --- a/lib/libcoolstream/playback_cs.h +++ b/lib/libcoolstream/playback_cs.h @@ -44,7 +44,7 @@ public: void DMNotify(int Event, void *pTsBuf, void *Tag); bool Open(playmode_t PlayMode); void Close(void); - bool Start(char * filename, unsigned short vpid, int vtype, unsigned short apid, int audio_flag); + bool Start(char * filename, unsigned short vpid, int vtype, unsigned short apid, int audio_flag, unsigned int duration = 0); bool Stop(void); bool SetAPid(unsigned short pid, int audio_flag); bool SetSpeed(int speed); diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 02afea801..574abc2cc 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -856,7 +856,11 @@ void CMoviePlayerGui::PlayFile(void) printf("IS FILE PLAYER: %s\n", is_file_player ? "true": "false" ); - if(!playback->Start((char *)filename, g_vpid, g_vtype, CAPIDSelectExec::g_currentapid, CAPIDSelectExec::g_currentac3)) { + duration = 0; + if(p_movie_info != NULL) + duration = p_movie_info->length * 60 * 1000; + + if(!playback->Start((char *)filename, g_vpid, g_vtype, CAPIDSelectExec::g_currentapid, CAPIDSelectExec::g_currentac3, duration)) { playback->Close(); restoreNeutrino(); } else { @@ -914,7 +918,9 @@ void CMoviePlayerGui::PlayFile(void) if(duration > 100) file_prozent = (unsigned char) (position / (duration / 100)); playback->GetSpeed(speed); -// printf("CMoviePlayerGui::PlayFile: speed %d position %d duration %d (%d, %d%%)\n", speed, position, duration, duration-position, file_prozent); +#ifdef DEBUG + printf("CMoviePlayerGui::PlayFile: speed %d position %d duration %d (%d, %d%%)\n", speed, position, duration, duration-position, file_prozent); +#endif if (duration - position < 1000 && !timeshift) { /* 10 seconds after end-of-file, exit */