home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Products
TV-Server
My small contribution I call - StreamTV
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Valk" data-source="post: 411239" data-attributes="member: 18631"><p>Well i've got close to another release.</p><p></p><p>If I can fix this problem with multiple .ts files i'll be set.</p><p></p><p>If anyone can help please reply, anyway at the moment i'm reading the .tsBuffer file and getting the files which contain the stream I care about and I can open the first .ts file and read it through.</p><p></p><p>Once it has reached the end of the file I try and change over to the next file and the 2nd file is locked.</p><p></p><p>For the moment i'm opening the files up as a filestream eg.</p><p>[code]</p><p>private void LoadNextBuffer()</p><p> {</p><p> Refresh();</p><p></p><p> // Check if the streamBuffer has a file already open.</p><p> if (tsNextStreamBuffer != null)</p><p> {</p><p> // Close off the buffer first.</p><p> try</p><p> {</p><p> tsNextStreamBuffer.Close();</p><p> }</p><p> catch (Exception) { }</p><p> }</p><p></p><p> // Check if there are any left to load.</p><p> if (tsFileLocation.Count == 0)</p><p> {</p><p> currentState = State.EndOfFile;</p><p> canPlay = false;</p><p> return;</p><p> }</p><p></p><p> String fileToLoad = tsFileLocation.Dequeue();</p><p> FileStream file = null;</p><p> int tries = 5;</p><p></p><p> do</p><p> {</p><p> // Load the next file into the buffer.</p><p> // First attempt.</p><p> try</p><p> {</p><p> file = new FileStream(fileToLoad, FileMode.Open, FileAccess.Read, FileShare.Read);</p><p> break;</p><p> }</p><p> catch (Exception)</p><p> {</p><p> //// Second attempt.</p><p> //try</p><p> //{</p><p> // file = new FileStream(fileToLoad, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite);</p><p> // break;</p><p> //}</p><p> //catch (Exception)</p><p> //{</p><p> // Final attempt. (Should work)</p><p> try</p><p> {</p><p> file = new FileStream(fileToLoad, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);</p><p> break;</p><p> }</p><p> catch (Exception)</p><p> {</p><p> System.Threading.Thread.Sleep(20);</p><p> }</p><p> //}</p><p> }</p><p> } while (tries-- != 0);</p><p></p><p> // Check if we managed to load the .ts file.</p><p> if (file == null)</p><p> {</p><p> nextState = State.FileLocked;</p><p> return;</p><p> }</p><p></p><p> // Update the streamBuffer with the new file.</p><p> tsNextStreamBuffer = file;</p><p></p><p> nextState = State.Loaded;</p><p> } // LoadNextBuffer[/code]</p><p></p><p>Once I have finished loading all the bytes out of the first .ts file I jump over to the 2nd file and start reading from it but sadly I can't load the 2nd .ts file.</p><p></p><p>If you know anything it would help alot since i'm running low on ideas.</p><p></p><p>Hopefully this issue will be resolved soon and I will be able to release a version that releases the Tv card when you disconnect <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" />. (I also started on group management but there is problems with that for now).</p><p></p><p>P.S. Just incase someone says anything my first attempt I didn't try to pre-load the next .ts file, I waited until I finished reading all the data out of the first one then tried to open the 2nd file with no success.</p></blockquote><p></p>
[QUOTE="Valk, post: 411239, member: 18631"] Well i've got close to another release. If I can fix this problem with multiple .ts files i'll be set. If anyone can help please reply, anyway at the moment i'm reading the .tsBuffer file and getting the files which contain the stream I care about and I can open the first .ts file and read it through. Once it has reached the end of the file I try and change over to the next file and the 2nd file is locked. For the moment i'm opening the files up as a filestream eg. [code] private void LoadNextBuffer() { Refresh(); // Check if the streamBuffer has a file already open. if (tsNextStreamBuffer != null) { // Close off the buffer first. try { tsNextStreamBuffer.Close(); } catch (Exception) { } } // Check if there are any left to load. if (tsFileLocation.Count == 0) { currentState = State.EndOfFile; canPlay = false; return; } String fileToLoad = tsFileLocation.Dequeue(); FileStream file = null; int tries = 5; do { // Load the next file into the buffer. // First attempt. try { file = new FileStream(fileToLoad, FileMode.Open, FileAccess.Read, FileShare.Read); break; } catch (Exception) { //// Second attempt. //try //{ // file = new FileStream(fileToLoad, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite); // break; //} //catch (Exception) //{ // Final attempt. (Should work) try { file = new FileStream(fileToLoad, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); break; } catch (Exception) { System.Threading.Thread.Sleep(20); } //} } } while (tries-- != 0); // Check if we managed to load the .ts file. if (file == null) { nextState = State.FileLocked; return; } // Update the streamBuffer with the new file. tsNextStreamBuffer = file; nextState = State.Loaded; } // LoadNextBuffer[/code] Once I have finished loading all the bytes out of the first .ts file I jump over to the 2nd file and start reading from it but sadly I can't load the 2nd .ts file. If you know anything it would help alot since i'm running low on ideas. Hopefully this issue will be resolved soon and I will be able to release a version that releases the Tv card when you disconnect :). (I also started on group management but there is problems with that for now). P.S. Just incase someone says anything my first attempt I didn't try to pre-load the next .ts file, I waited until I finished reading all the data out of the first one then tried to open the 2nd file with no success. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Products
TV-Server
My small contribution I call - StreamTV
Contact us
RSS
Top
Bottom