Page 1 of 1

fread harddisk files and crash problem!?

Posted: 16 May 2010 07:42
by passionggg
hi,all
today, i writed several codes in the file /modules/codec/avcodec/video.c to read a harddisk file into the memory. But crashed. the codes is as follows:
File *f;
char *path="F:/data.DAT";
int *table;
f=fopen(path,'rb');
tabel = malloc(SIZE);
fread(table,sizeof(int),Size,f);
then compile and make package-win32-base successfully. But can not open any files. once open then shut down.
What's the problem?
Hope for help!!!

Re: fread harddisk files and crash problem!?

Posted: 16 May 2010 17:29
by VLC_help
What is the SIZE or Size?

Re: fread harddisk files and crash problem!?

Posted: 17 May 2010 04:09
by passionggg
"SIZE" is the size of "data.DAT" that is malloc a memory space to place the data.DAT from harddisk.
and the "Size" is the "table" size.
for example, SIZE is (sizeof(int)*1280*720), Size is (1280*720).
Thanks

Re: fread harddisk files and crash problem!?

Posted: 17 May 2010 16:59
by VLC_help
Have you tried to use gdb?

Re: fread harddisk files and crash problem!?

Posted: 18 May 2010 02:55
by passionggg
Yes, i used gdb. But when give a breakpoint in the file /modules/codec/avcodec/video.c, the program can not run to this point, and a problem occured that i don't understand.
Now i do not go this way. I want to use the libvlc which i complied myself.
I set up an MFC project in VS2008 by using libvlc to read rtsp streaming from an IPCamera(h264 encoded stream). I want to get the each decoded frame data from the stream. Does VLC have a register or callback function that respond when each frame has decoded and the parameters of the function contains the decoded data of each frame? Like the function"libvlc_video_snapshot" which can take a snapshot of the video.
Thanks. Hope for answers.

Re: fread harddisk files and crash problem!?

Posted: 18 May 2010 17:38
by VLC_help
You can use memory output module aka vmem.

Re: fread harddisk files and crash problem!?

Posted: 19 May 2010 07:44
by passionggg
Thanks vlc_help and everyone.
now i have solved this problem using vmem video output. and see the Qt example.!