Mercurial > hg > easaier-soundaccess
changeset 138:3b2b790e47e5
(none)
author | ivand_qmul |
---|---|
date | Fri, 09 Nov 2007 12:58:47 +0000 |
parents | 78b56ed1031e |
children | 2d883a374b79 |
files | data/fileio/VideoFileReader.cpp data/model/SDLWidget.cpp sv/main/MainWindow.cpp sv/videoio/SDL_ffmpeg.cpp |
diffstat | 4 files changed, 12 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/data/fileio/VideoFileReader.cpp Fri Nov 09 10:36:16 2007 +0000 +++ b/data/fileio/VideoFileReader.cpp Fri Nov 09 12:58:47 2007 +0000 @@ -33,6 +33,8 @@ #include <Windows.h> #endif long long countFreq; +int Videow=320; +int Videoh=240; VideoFileReader::VideoFileReader(QString path, bool showProgress, CacheMode mode) : CodedAudioFileReader(mode), m_path(path) @@ -191,6 +193,8 @@ // exists, width and height are set to default values (320x240) SDL_ffmpegGetVideoSize(file, &w, &h); SDL_Init(SDL_INIT_VIDEO); + Videow=w; + Videoh=h; // Open the Video device screen = SDL_SetVideoMode(w, h, 0, SDL_DOUBLEBUF|SDL_HWSURFACE); //SDL_WM_SetCaption("EASAIER Video Player", "EASAIER Video Player");
--- a/data/model/SDLWidget.cpp Fri Nov 09 10:36:16 2007 +0000 +++ b/data/model/SDLWidget.cpp Fri Nov 09 12:58:47 2007 +0000 @@ -2,14 +2,16 @@ #include <cstdlib> #include <ctime> #include "SDLWidget.h" +extern int Videow; +extern int Videoh; SDLWidget::SDLWidget() :windowInitialized(false), screen(0) { setAttribute(Qt::WA_PaintOnScreen); setAttribute(Qt::WA_NoSystemBackground); - setMinimumSize(320,240); - resize(320, 240); + setMinimumSize(720,576); + resize(Videow, Videoh); } SDLWidget::~SDLWidget() @@ -20,6 +22,7 @@ void SDLWidget::showEvent(QShowEvent *e) { (void)e; + if(!windowInitialized) { // it's here the link between SDL and QT
--- a/sv/main/MainWindow.cpp Fri Nov 09 10:36:16 2007 +0000 +++ b/sv/main/MainWindow.cpp Fri Nov 09 12:58:47 2007 +0000 @@ -117,7 +117,6 @@ using std::map; using std::set; -extern float hopfactor; extern long long countFreq; MainWindow * MainWindow::m_instance = 0; @@ -3595,7 +3594,7 @@ QueryPerformanceCounter((LARGE_INTEGER *)(&timeTemp)); pos=(timeTemp-m_playSource->hardwareBufferedTime)/(countFreq); - pos*=hopfactor; + pos*=getPlaySpeedVal(); } return (newAudioTime+pos); }
--- a/sv/videoio/SDL_ffmpeg.cpp Fri Nov 09 10:36:16 2007 +0000 +++ b/sv/videoio/SDL_ffmpeg.cpp Fri Nov 09 12:58:47 2007 +0000 @@ -46,7 +46,7 @@ //const int SDL_FFMPEG_MAX_BUFFERED_FRAMES = 25; //const int SDL_FFMPEG_MAX_BUFFERED_SAMPLES = 512 * 512; -extern float hopfactor; + int FFMPEG_init_was_called = 0; FILE *pFile, *tFile; int64_t Time,Time1; @@ -370,7 +370,7 @@ fprintf (tFile, "%u\t", x); fprintf (tFile, "%u\t", realt); fprintf (tFile, "%u\t", tt); - timestamp=(pos-option->timestamp+((AVFormatContext*)file->_ffmpeg)->start_time/1000)/hopfactor; + timestamp=(pos-option->timestamp+((AVFormatContext*)file->_ffmpeg)->start_time/1000)/MWinsA->getPlaySpeedVal(); fprintf (tFile, "%u\t", pos);//+ (file->vs[file->videoStream]->timeBase)/4+((AVFormatContext*)file->_ffmpeg)->start_time/1000); fprintf (tFile, "%d\n", timestamp); // we did found an option, so we return the imagedata