123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|627|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> On Topic -> file access?

Sat, 19 Jan 2008, 12:45
spinal
Just wondering what is better...

Opening the same file twice for reads, or opening the file only onces and seeking back and forth between the two required chunks of data?

-=-=-
Check out my excellent homepage!
Sat, 19 Jan 2008, 13:00
power mousey

opening the file once and seeking out the chunks of memory
you need or want.

No problem with a text file. But if its too long for sequential acces...then utilize a binary file of some kind.
And yes, positioning the file pointer and seeking the chunks you want.

But if you do open the file twice...wouldn't the file pointer point to the beginning of the start of the first chunk?


Sat, 19 Jan 2008, 13:04
spinal
I meant open file once, start read from beginning, open it the second time, seek to the start of the second chunk of data, start reading. But if you say opening the file only once is better, I'll go with that. Its for my movie player btw, I'm having the audio at the start, then the frames after it.

-=-=-
Check out my excellent homepage!
Sat, 19 Jan 2008, 13:13
power mousey

I understood your question and further intentional
question down the road...so to speak.

However, once you close the file, and then reopen the file
the file pointer will init back to the start or the beginning of the file.

So, just open the file once and work with the contents or chunks.


Sat, 19 Jan 2008, 14:54
mike_g
Tbh it doesent really matter too much. Most video formats tend to be interlaced. You could interlace your movie file, or use an interlaced format. This would then be read sequentially as a bit of video, bit of audio, video, audio, etc.

No problem with a text file. But if its too long for sequential acces...then utilize a binary file of some kind.
And yes, positioning the file pointer and seeking the chunks you want.

Erm.. I don't get what you mean? Its sounds as if you are getting a binary file mixed up with a binary search.


Sat, 19 Jan 2008, 15:52
spinal
mike_g - I tried that with the first version of the format, but I kept getting frame rate and audio problems, I have since tried using two files, one with the frames and one with the audio. This way works fine, I'm getting slightly higher frame rate (not much mind) and the audio is staying in sync, I have not yet tried combining the audio and video into the same file again yet though.

-=-=-
Check out my excellent homepage!
Sat, 19 Jan 2008, 18:43
power mousey


At the time, I didn't know how to convey what you were trying to do.

I'm not familar with video,audio termilogy nor
knowledge. But originally, I was thinking along
the lines of a film reel with a film strip.
Thats where I came up partially with sequential.

But, I have learned something new and more.
Thank you.