PDA

View Full Version : diff and neutrino - Help



ozbodd
25-01-2008, 07:57 PM
I have got the CVS and edited a file and saved to my linux desktop.
I tried

cvs diff -pul movieplayer.cpp movieplayer.cpp > movieplayer_diff.txt
I get a CVSROOT environment error? Searched Google and found to set

export CVSROOT="/home/y/tuxbox/tuxbox-cvs"

Tried the first command again and get the following error

cvs diff -pul movieplayer.cpp movieplayer.cpp > movieplayer_diff.txt
cvs diff: cannot open CVS/Entries for reading: No such file or directory
cvs diff: I know nothing about movieplayer.cpp

The path to MP is

/home/y/tuxbox/tuxbox-cvs/apps/tuxbox/neutrino/src/gui/movieplayer.cpp

I'v managed a diff file using just diff but am unsure this is suitable or not.

movieplayer basic diff command:

3023d3022
<
3027,3044c3026,3027
< //Hardcoded to test only; want a MP setting in conf- Jan08
< g_settings_streaming_allow_random == true;
< //Can I add a new MP Setting to the .conf file? - Jan08
< if (!g_settings_streaming_allow_random)
< {
< ctx->it++;
< if(ctx->it < ctx->lst_cnt) ctx->itChanged = true;
< fprintf(stderr, "[mp] Playlist item? = [%d]\n", ctx->it );
< }
< else
< {
< //-- This will probably just play random files indefinitely with repeats until [Home key] to exit
< srand(time(0));
< // generates random number between 1 and lst_cnt - Jan08
< ctx->it = rand() % ctx->lst_cnt + 1;
< ctx->itChanged = true;
< fprintf(stderr, "[mp] Random playlist item? = [%d]\n", ctx->it );
< }
---
> ctx->it++;
> if(ctx->it < ctx->lst_cnt) ctx->itChanged = true;
3047a3031
>

Help appreciated

renwich
26-01-2008, 12:02 AM
try



diff -Nur tuxbox-cvs-orig tuxbox-cvs > diff.diff


works for me :thumbup2:

nj2006
26-01-2008, 12:07 AM
try

diff -Nur tuxbox-cvs-orig tuxbox-cvs > diff.diff
works for me :thumbup2:


but make sure you have a freash cvs in tuxbox-cvs-orig

mastake i made ;)

ozbodd
26-01-2008, 12:19 AM
OK I couldn't get it to work but did find Cervisia, a GUI for CVS set up in the VM and it did the trick.
Here is the diff incl @Seife's patch

Index: movieplayer.cpp
================================================== =================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/src/gui/movieplayer.cpp,v
retrieving revision 1.158
diff -U3 -r1.158 movieplayer.cpp
--- a/movieplayer.cpp 9 Dec 2007 23:30:53 -0000 1.158
+++ b/movieplayer.cpp 25 Jan 2008 23:08:22 -0000
@@ -1661,11 +1661,11 @@
//-----------------------------------
for(;;)
{
- if (isTerminated) return NULL; // abort
-
//-- check low level ... --
if ( level < 2 )
- {
+ {
+ if (isTerminated) return NULL; // abort
+
//-- ... and freeze playback --
if (!freezed)
{
@@ -1681,6 +1681,8 @@
//-- in freezed state --
else if (freezed)
{
+ if (isTerminated) return NULL; // abort
+
//-- wait for buffer filled or ... --
if ( level < nSegsOpt )
{
@@ -3020,15 +3022,31 @@
}
else
{
+
//-- eventually activate autoplay for next file in a playlist --
if( (ctx->itChanged == false) && ctx->lst_cnt )
{
- ctx->it++;
- if(ctx->it < ctx->lst_cnt) ctx->itChanged = true;
+ //Hardcoded to test only; want a MP setting in conf- Jan08
+ g_settings_streaming_allow_random == true;
+ //Can I add a new MP Setting to the .conf file? - Jan08
+ if (!g_settings_streaming_allow_random)
+ {
+ ctx->it++;
+ if(ctx->it < ctx->lst_cnt) ctx->itChanged = true;
+ fprintf(stderr, "[mp] Playlist item? = [%d]\n", ctx->it );
+ }
+ else
+ {
+ //-- This will probably just play random files indefinitely with repeats until [Home key] to exit
+ srand(time(0));
+ // generates random number between 1 and lst_cnt - Jan08
+ ctx->it = rand() % ctx->lst_cnt + 1;
+ ctx->itChanged = true;
+ fprintf(stderr, "[mp] Random playlist item? = [%d]\n", ctx->it );
+ }
}
close(ctx->inFd);
}
-
ctx->inFd = -1;
}

Now - How can I turn that into a neutrino?

When I finally get this tested I am hoping it will just play a multi-select randomly.
Thanks for your help - Learning quite a bit about this now.

FreddyFr0g
26-01-2008, 06:03 PM
I'm no quite sure what you are trying to achieve m8, do you mean you want to produce the neutrino bin file (and not a neutrino image).
If yes, you just need to apply the patch (or change manually the relevant bits in the movieplayer.cpp file), go to your cdk folder, type ./autogen.sh.
Then time to run the configure command (with the options taken from nitr8's guide), then make a yadd image by typing make yadd-neutrino. You'll have all the bin files generated (including neutrino) under which ever folder you put in the --prefix option at the configure stage.
There's probably a way to compile only the neutrino bin but you might as well have everything.... doesn't take long to run once you have done it once... but can take up to 2 hours the first time.

ozbodd
26-01-2008, 06:22 PM
Thanks m8 - I don't know what I am asking either :flag:


That makes a bit more sense, I couldn't work out what this neutrino file was, so it is just one of the compiled files for the image.

Thought I was going to end up with a flash image - which I don't want...

I'll try again - just screwed up my VM messing with the resolution setting so have to start over again.

Is there a way to apply a diff file to movieplayer.cpp to save me having to re-edit it?

nj2006
26-01-2008, 07:49 PM
$ patch -p1<diffname.diff


hope this helps

renwich
26-01-2008, 08:54 PM
and if you just want the neutrino


make neutrino

ozbodd
26-01-2008, 09:21 PM
Two more questions:

For the patch - Where do I put the diff to run that command?

For the Make - Where does the neutrino file get created?
Found one in cdkroot/bin/?

renwich
26-01-2008, 10:57 PM
diffs I normally leave in ~/tuxbox

my structure

/whatever/tuxbox

and under this I have

dbox2

Private

tuxbox-cvs

tuxbox-cvs-orig

--------------------------------------------------------


normally I would do a full build first

make flash-neutrino-jffs2-all

then all is found under dbox2/cdkflash


then I would make mostlyclean


then make neutrino

ozbodd
27-01-2008, 05:18 PM
If you are interested in following this - I'll keep it in one post.

dbox2 / linux &bull; Thema anzeigen - Movieplayer random play & playlist (http://tuxbox-forum.dreambox-fan.de/forum/viewtopic.php?f=9&t=47411&p=351628#p351628)