XBMC Community Forum
EDL (and ComSkip) integration - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Development (/forumdisplay.php?fid=93)
+--- Thread: EDL (and ComSkip) integration (/showthread.php?tid=27798)

Pages: 1 2 3 4 5 6


EDL (and ComSkip) integration - DrDDT - 2007-08-07 13:44

Hi!

I'm trying implement EDL for XBMC
(see http://forum.xbmc.org/showthread.php?tid=21890&page=4)

I'm very new to XBMC development so please be patient with me.

I'm trying to add the option 'path_to_movie\movie.edl' to the mplayer options, if the file 'path_to_movie\movie.edl' exists.

As suggested, I'll have to do the following:

- Check if the filename give to mplayer is actually a movie and not a stream/playlist:

// Check if file can have EDL
if (item.IsInternetStream()) ....
if (item.IsPlayList()) ....
if (!item.IsVideo()) ....

- If the file can have an edl, generate the possible filename:

CStdString strEdlFileName;
ReplaceExtension(strFile, "edl", strEdlFileName);

- Check if 'path_to_movie\movie.edl' exists
-[ How do I do this? ]-

- Add the option to the mplayer conf
Someting like:

options.SetEDLFile(strFile);

if (m_stredlfile.length() > 0)
{
m_vecOptions.push_back("-edl=" + m_stredlfile );
}


Is this going to work?
How do I check if the EDL file exists?


- spiff - 2007-08-07 13:54

CFile::Exists

and yes it will work


- DrDDT - 2007-08-07 14:58

spiff Wrote:CFile::Exists

and yes it will work

I gave it a shot, it compiles, but I cannot test it yet:

Code:
Index: mplayer.cpp

===================================================================

--- mplayer.cpp    (revision 9840)

+++ mplayer.cpp    (working copy)

@@ -122,6 +122,7 @@

   m_bLimitedHWAC3 = false;
   m_bDeinterlace = false;
   m_subcp = "";
+  m_strEdl = ""; // DD
   m_synccomp = 0.0f;
}
void CMPlayer::Options::SetFPS(float fFPS)
@@ -279,6 +280,12 @@

   m_iAutoSync = iAutoSync;
}

+// DD
+void CMPlayer::Options::SetEdl(const string& strEdl)
+{
+  m_strEdl = strEdl;
+}
+
void CMPlayer::Options::GetOptions(int& argc, char* argv[])
{
   CStdString strTmp;
@@ -332,6 +339,13 @@

     }
   }

+    // DD
+  if (m_strEdl.length() > 0)
+  {
+      m_vecOptions.push_back("-edl=" + m_strEdl );
+      CLog::Log(LOGINFO, "Found EDL file, adding -edl=%s", m_strEdl.c_str());
+  }
+
   //MOVED TO mplayer.conf
   //Enable mplayer's internal highly accurate sleeping.
   //m_vecOptions.push_back("-softsleep");
@@ -858,6 +872,17 @@

     m_iPTS = 0;
     m_bPaused = false;

+    // DD Check for EDL file
+    CStdString strEdlFileName;
+    if (!bFileOnInternet && bIsVideo && !bIsDVD )
+    {
+        CUtil::ReplaceExtension(strFile, "edl", strEdlFileName);
+        if ( CFile::Exists(strEdlFileName) )
+        {
+            options.SetEdl(strEdlFileName);
+        }
+    }
+
     // first init mplayer. This is needed 2 find out all information
     // like audio channels, fps etc
     load();
Index: MPlayer.h

===================================================================

--- MPlayer.h    (revision 9840)

+++ MPlayer.h    (working copy)

@@ -61,6 +61,9 @@


     void SetAutoSync(int iAutoSync);

+    // DD
+    void SetEdl(const string& strEdl);
+
     void SetAudioOutput(const string& output) { m_videooutput = output; }
     void SetVideoOutput(const string& output) { m_audiooutput = output; }
     void SetAudioCodec(const string& codec) { m_videocodec = codec; }
@@ -94,6 +97,7 @@

     string m_demuxer;
     bool m_bDisableAO;
     string m_subcp;
+    string m_strEdl;
     string m_strChannelMapping;
     string m_strDvdDevice;
     string m_strFlipBiDiCharset;



- spiff - 2007-08-07 15:02

i havent tested it either but your diff is unacceptable for inclusion
indent is 2 space using spaces, please comply. and i'd prefer if you didnt spam your name all over the file. (do not mistake this for hostility)


- DrDDT - 2007-08-07 15:10

spiff Wrote:i havent tested it either but your diff is unacceptable for inclusion
indent is 2 space using spaces, please comply. and i'd prefer if you didnt spam your name all over the file. (do not mistake this for hostility)

This patch wasn't meant for inclusion, sorry I didn't make this clear.
The 'name spamming' is only for me to find my own changes. I haven't coded a single line for over ten years, so I'm a bit rusty.

I'll test it first, then I'll find the correct formatting and submit rules for patches.


- spiff - 2007-08-07 15:18

cool


- DrDDT - 2007-08-08 13:18

I've got it working now (after a few bugfixes).

I'll try to add a on/off switch in the settings now.


- spiff - 2007-08-08 13:31

why would we want that? if you dont want your edls, rename them / delete them.


- DrDDT - 2007-08-08 17:32

spiff Wrote:why would we want that? if you dont want your edls, rename them / delete them.

Doesn't the same goes for subtitles?
If I have a recorded tv show, and have comskip generate an edl for removing commercials, I might want to disable the EDL because too much of the show was disabled.

Maybe later then.


- spiff - 2007-08-08 23:54

oh sorry you mean an osd option. a conditional osd option (only shown if we have an edl) is all fine. i thought you meant a "real" setting in settings->video.