Mercurial > hg > easaier-soundaccess
diff sv/videoio/SDL_ffmpeg.cpp @ 256:6eeb195adbb4
Video works fine now.
Ivan fixed bugs.
author | benoitrigolleau |
---|---|
date | Tue, 17 Jun 2008 11:59:02 +0000 |
parents | f0e9330bee36 |
children |
line wrap: on
line diff
--- a/sv/videoio/SDL_ffmpeg.cpp Fri Jun 13 13:42:15 2008 +0000 +++ b/sv/videoio/SDL_ffmpeg.cpp Tue Jun 17 11:59:02 2008 +0000 @@ -46,9 +46,10 @@ //const int SDL_FFMPEG_MAX_BUFFERED_FRAMES = 25; //const int SDL_FFMPEG_MAX_BUFFERED_SAMPLES = 512 * 512; -extern float zoomFivan; +extern int zoomWivan; +extern int zoomHivan; int FFMPEG_init_was_called = 0; -FILE *pFile, *tFile; +//FILE *pFile, *tFile; int64_t Time,Time1; int64_t realt=0; @@ -63,8 +64,8 @@ Time=0; Time1=0; - fopen_s (&pFile,"myfile.txt","w"); - fopen_s (&tFile,"Timestampfile.txt","w"); + //fopen_s (&pFile,"myfile.txt","w"); + // fopen_s (&tFile,"Timestampfile.txt","w"); // allocate room for VStreams file->vs = (SDL_ffmpegStream**)malloc( sizeof(SDL_ffmpegStream*) * MAX_STREAMS ); if(!file->vs) { @@ -268,10 +269,10 @@ //for(i=0; i<SDL_FFMPEG_MAX_BUFFERED_FRAMES; i++) { pos=MWinsA->Get_CurAudioTime(); - if (pFile) +/* if (pFile) { fprintf (pFile, "p: \t %u\t", pos); - } + }*/ //if (MWinsA->Get_HardwareBufferTime()==0) // pos1=0; //else { @@ -284,10 +285,10 @@ // fprintf (pFile, "%u\t", pos1); //} //pos2=pos+pos1; - if (pFile) + /*if (pFile) { fprintf (pFile, "%u\n", pos); - } + }*/ // if this entry does not exist, continue while(((file->vs[file->videoStream]->writeImage - file->vs[file->videoStream]->readImage)>0)&&(file->vs[file->videoStream]->imageBuffer[file->vs[file->videoStream]->readImage%SDL_FFMPEG_MAX_BUFFERED_FRAMES]->timestamp <= pos + ((AVFormatContext*)file->_ffmpeg)->start_time/1000))//&& (file->vs[file->videoStream]->imageBuffer[file->vs[file->videoStream]->readImage%SDL_FFMPEG_MAX_BUFFERED_FRAMES]->timestamp >= pos - file->timebase+ ((AVFormatContext*)file->_ffmpeg)->start_time/1000)) @@ -333,10 +334,10 @@ pos=MWinsA->Get_CurAudioTime(); - if (pFile) + /* if (pFile) { fprintf (pFile, "e:\t%u\t", pos); - } + }*/ //if (MWinsA->Get_HardwareBufferTime()==0) // pos1=0; //else { @@ -376,12 +377,12 @@ QueryPerformanceCounter((LARGE_INTEGER *)(&file->timer)); file->timer=file->timer/(file->countFreq); realt+=tt; - fprintf (tFile, "%u\t", x); + /*fprintf (tFile, "%u\t", x); fprintf (tFile, "%u\t", realt); - fprintf (tFile, "%u\t", tt); + fprintf (tFile, "%u\t", tt);*/ 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); + /*fprintf (tFile, "%u\t", option->timestamp);//+ (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 return option->img; } @@ -619,8 +620,8 @@ // if new timestamp is from future, we proceed // if(buf->timestamp >= SDL_ffmpegGetPosition(file)) // { - int w=(int)(zoomFivan*320+0.5); - int h=(int)(zoomFivan*240+0.5); + int w=zoomWivan;//(int)(zoomFivan*320+0.5); + int h=zoomHivan;//(int)(zoomFivan*240+0.5); //if ((w>file->vs[file->videoStream]->width)||(h>file->vs[file->videoStream]->height)){ // w=file->vs[file->videoStream]->width; // h=file->vs[file->videoStream]->height;