MediaPortal Forums HTPC/MediaCenter

Go Back   MediaPortal Forum » MediaPortal 1 » Main Features (talk, share your ideas, get support) » Watch / Listen Media » MyTV - Engine 0.2 » Tips and Tricks


Tips and Tricks Post your Tips and Tricks in here.

Reply
 
Thread Tools Display Modes
Old 2007-10-03, 10:17   #21 (permalink)
Portal Member
 
Join Date: Jan 2006
Posts: 90
Thanks: 2
Thanked 5 Times in 4 Posts


Default

The source of dvrcut is on my server so feel free to start the debugger and find out why.
Or upload a 3GB dvr-ms file to my server and let me do the debugging, but that will take more time I guess.
erik1958 is online now   Reply With Quote
Old 2007-10-03, 15:34   #22 (permalink)
Portal Member
 
Join Date: Aug 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts

Country:


fixed

I went ahead and debugged since I didn't expect a response (thanks for responding though!)... Good news, I found the problem and it was pretty simple!

The issue never happened when I debugged, always happened when it was used live... so I figured there was a file handle/lock issue somewhere, and that the thread was acting more quickly than the file system. So I added a reference to System.Threading, and added a "Thread.Sleep(500);" at the end of the while loop, problem solved. You may want to integrate this, as there are a fair number of uses who have experienced the same thing I have. Thanks!

This is the new SBECutter.cs; I marked the two lines I added.

Quote:
PHP Code:
/****************************************************************************
While the underlying libraries are covered by LGPL, this sample is released 
as public domain.  It is distributed in the hope that it will be useful, but 
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
or FITNESS FOR A PARTICULAR PURPOSE.  
*****************************************************************************/

using System;
using System.Runtime.InteropServices;
//*****ADDED THE FOLLOWING LINE*****
using System.Threading;

using DirectShowLib.SBE;

namespace DirectShowLib.Sample
{
    public class 
SBECutter IDisposable
    
{
    
// SBE provide an utility object for cutting SBE files
    
IStreamBufferRecComp recComp;

        public 
SBECutter()
        {
      
// Create this object
      
recComp = (IStreamBufferRecComp) new StreamBufferComposeRecording();
    }

    ~
SBECutter()
    {
      
Dispose();
    }

    public 
void Dispose()
    {
      
// Realease it
      
if (recComp != null)
        
Marshal.ReleaseComObject(recComp);

      
GC.SuppressFinalize(this);
    }

    public 
void DoCut(string srcFilestring dstFileint cntTimeSpan[] startTimeSpan [] stop)
    {
      
int hr 0;

      
// Initialize a destination file with the same profil as source file
      
hr recComp.Initialize(dstFilesrcFile);
      
DsError.ThrowExceptionForHR(hr);

      
// Copy source file into destination file
      
int i 0;
      while (
cnt)
      {
          
hr recComp.AppendEx(srcFilestart[i].Ticksstop[i].Ticks);
          
DsError.ThrowExceptionForHR(hr);
          
i++;
          
//*****ADDED THE FOLLOWING LINE*****
          
Thread.Sleep(500); //Prevents application from hanging when handling large files.
      
}
      
// Close destination file
      
hr recComp.Close();
      
DsError.ThrowExceptionForHR(hr);
    }

  }


Last edited by judolphin; 2007-10-03 at 15:40. Reason: Forum removed indentation
judolphin is offline   Reply With Quote
Old 2007-10-03, 16:29   #23 (permalink)
Portal Member
 
Join Date: Jan 2006
Posts: 90
Thanks: 2
Thanked 5 Times in 4 Posts


Default

Nice!, thanks.
As I no longer have the CS development environment (I am a plain old C guy), can someone compile an updated DVRCut for me?
erik1958 is online now   Reply With Quote
Old 2007-10-03, 16:40   #24 (permalink)
Portal Member
 
Join Date: Aug 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts

Country:


Default

Quote:
Originally Posted by erik1958 View Post
Nice!, thanks.
As I no longer have the CS development environment (I am a plain old C guy), can someone compile an updated DVRCut for me?
Post your email and I'll send you the binary.
judolphin is offline   Reply With Quote
Old 2007-10-03, 17:59   #25 (permalink)
Portal Member
 
Join Date: Jan 2006
Posts: 90
Thanks: 2
Thanked 5 Times in 4 Posts


Default

Its in
http://www.kaashoek.com/comskip/files/DVRcutsrc1.1.ZIP
erik1958 is online now   Reply With Quote
Old 2007-10-04, 00:07   #26 (permalink)
Portal Member
 
Join Date: Aug 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts

Country:


Default

Your email address is nowhere to be found in that package.

Here you go... requires DirectShow 1.3... http://download.yousendit.com/B09E97B822023113

Last edited by judolphin; 2007-10-04 at 00:18. Reason: Automerged Doublepost
judolphin is offline   Reply With Quote
Reply

Bookmarks

Tags
079, added, build, comskip, dvrcut, format, output

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
ASUS WDM TV/FM 7134 is supported River Mead General Support 6 2007-08-27 16:12
MP crashing after viewing 21 videos endeneu The old Bugreport Forum 27 2006-06-07 22:58
Problem with audio on DVB/t channel veisfeld General Support 1 2006-04-16 11:08
Radio autotune crash MP configuration pisdu General Support 2 2006-04-10 13:57
RC2 causes laptop to hibernate every 5 mins ms2005 MediaPortal 1 Talk 6 2005-12-19 15:26


All times are GMT +1. The time now is 19:09.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 Protected by Akismet Blog with WordPress
Advertisement System V2.6 By   Branden