Jump to content


Photo

Playing off dvd.iso and resume.


  • Please log in to reply
33 replies to this topic

#1 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 11 August 2015 - 11:02

I'm currently bussy to improve the dvd iso player (basic included in pli4 image standard player).

To all no need to install any extra plugin or whatever.

 

The resume position did worked for a couple off dvd's for others not.

The reason for that is now found.

 

I have in this toppic a first enigma2 patch which is only the first phase. This patch is not push ready yet.

 

What it does :

 

1) restore the ability to resume a dvd.

2) For many dvd's it is required to pass by main menu play media command.

    By these dvd's if there is a resume position. It will be used after that You activated the dvd trough the menu .

3) When resuming a dvd You're previous selections off audio and subtitle settings will be used.

 

What is not ok yet.

 

Now the dvd always resume even if You answer no by the msg box resume yes or no.

 

This last issue can be solved by adding an extra parameter which sets a var into servicedvd.cpp. And based on that we will be able to not resume when starting dvd.

 

But how to do this I don't in python. I well left the code from littlesat commented as I think that :

#		service = self.session.nav.getCurrentlyPlayingServiceOrGroup()

Will be very usefull for this.

 

Included the patch against last git enigma2.

 

Would be nice iff a lot test it and a python expert can eventually see what the best way is to let the do not resume option work again.

 

 

Attached Files



Re: Playing off dvd.iso and resume. #2 littlesat

  • PLi® Core member
  • 56,273 posts

+691
Excellent

Posted 11 August 2015 - 13:00

How do you ensure for which "movie on the DVD" the resume point is required for???


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Playing off dvd.iso and resume. #3 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 11 August 2015 - 13:12

How do you ensure for which "movie on the DVD" the resume point is required for???

That is done based on dvd title. The file is made into /home/root  and named based on dvd tittle or if lack on dvd tiitle st.mimetime.

 

But Thta's whay I wrote such a hugh comment in my patch about certain code  by sevicedvd.cpp ;)

void eServiceDVD::saveCuesheet()
{
	eDebug("[eServiceDVD] saveCuesheet");

	struct ddvd_resume resume_info;
	ddvd_get_resume_pos(m_ddvdconfig, &resume_info);

	if (resume_info.title)
	{
		struct ddvd_time info;
		ddvd_get_last_time(m_ddvdconfig, &info);
		pts_t pos;
		pos = info.pos_hours * 3600;
		pos += info.pos_minutes * 60;
		pos += info.pos_seconds;
		pos *= 90000;
		m_cue_pts = pos;
		eDebug("[eServiceDVD] ddvd_get_resume_pos resume_info.title=%d, chapter=%d, block=%lu, audio_id=%d, audio_lock=%d, spu_id=%d, spu_lock=%d  (pts=%llu)",resume_info.title,resume_info.chapter,resume_info.block,resume_info.audio_id, resume_info.audio_lock, resume_info.spu_id, resume_info.spu_lock,m_cue_pts);
	}
	else
	{
		eDebug("[eServiceDVD] we're in a menu or somewhere else funny. so save cuesheet with pts=0");
		m_cue_pts = 0;
	}
/*  CVR This first file search to the m_ref.path/dvd.cuts is very questionable but since a really ,
	do not have a clue why it is there I leave it for the time being.
	But in openpli only the if (f == NULL) file patch location and name is used.
	Thats why To avoid a usseles saving off file with o position, and to remove an eventual existing file,
	The only right location off extra code is where I did it. */
	FILE* f;
	{
		std::string filename = m_ref.path;
		filename += "/dvd.cuts";
		f = fopen(filename.c_str(), "wb");
	}
	if (f == NULL)
	{
		char filename[128];
		if ( m_ddvd_titlestring[0] != '\0' )
			snprintf(filename, sizeof(filename), "/home/root/dvd-%s.cuts", m_ddvd_titlestring);
		else
		{
			struct stat st;
			if (stat(m_ref.path.c_str(), &st) == 0)
			{
				// DVD has no name and cannot be written. Use the mtime to generate something unique...
				snprintf(filename, 128, "/home/root/dvd-%lx.cuts", st.st_mtime);
			}
			else
			{
				strcpy(filename, "/home/root/dvd-untitled.cuts");
			}
		}
		/* CVR it does not make sense to keep a resume file with position 0 */
		if (m_cue_pts == 0)
		{
			if (::access(filename, F_OK) == 0)
				remove(filename);
		}
		else
		{
			eDebug("[eServiceDVD] saveCuesheet filename=%s",filename);
			f = fopen(filename, "wb");
		}
	}

	if (f)
	{
		unsigned long long where;
		int what;

		where = htobe64(m_cue_pts);
		what = htonl(3);
		fwrite(&where, sizeof(where), 1, f);
		fwrite(&what, sizeof(what), 1, f);

		what = htonl(4);
		fwrite(&resume_info, sizeof(struct ddvd_resume), 1, f);
		fwrite(&what, sizeof(what), 1, f);

		fclose(f);
	}
}

This procedure which starts (also present by loadcuesheet() ) seems completely usseless. And like You said if such file would really exists .... We are at the wild west in my opinion. :P

/*  CVR This first file search to the m_ref.path/dvd.cuts is very questionable but since a really ,
	do not have a clue why it is there I leave it for the time being.
	But in openpli only the if (f == NULL) file patch location and name is used.
	Thats why To avoid a usseles saving off file with o position, and to remove an eventual existing file,
	The only right location off extra code is where I did it. */
	FILE* f;
	{
		std::string filename = m_ref.path;
		filename += "/dvd.cuts";
		f = fopen(filename.c_str(), "wb");
	}

The patch is not a final to push , but in my opinion that code above is ....... :blink: :huh:  :wacko: 

 

And unless someone can tell me the use off it off course we remove it. And keep that based on the dvd title. Which on it is very bright .



Re: Playing off dvd.iso and resume. #4 littlesat

  • PLi® Core member
  • 56,273 posts

+691
Excellent

Posted 11 August 2015 - 16:45

That is done based on dvd title. The file is made into /home/root  and named based on dvd tittle or if lack on dvd tiitle st.mimetime. 

 

->

 

I suggest we do not understand.. on one DVDs you could have many 'video's'.... for which is the resume point value....???

In addition you need to remove the resume point in case you do not want to resume...


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Playing off dvd.iso and resume. #5 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 11 August 2015 - 17:19

That is done based on dvd title. The file is made into /home/root  and named based on dvd tittle or if lack on dvd tiitle st.mimetime. 

 

->

 

I suggest we do not understand.. on one DVDs you could have many 'video's'.... for which is the resume point value....???

In addition you need to remove the resume point in case you do not want to resume...

 

I di not make like its is , but find it very good . And for one dvd there can only be one position where you stopped the dvd. That is all the resume positions out.

 

I really can't follow the chiness langauge whitout any sence you're speaking off.  :huh:



Re: Playing off dvd.iso and resume. #6 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 11 August 2015 - 17:50

I hope a couple off real experts will join the discussion since now only one one is present, and that one removed completely ingorent  the possibility to resume a dvd for a lot off dvd's where it alwyas worked.



Re: Playing off dvd.iso and resume. #7 littlesat

  • PLi® Core member
  • 56,273 posts

+691
Excellent

Posted 11 August 2015 - 21:03

can you at least remove all these remarks in your commits....

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Playing off dvd.iso and resume. #8 mirakels

  • Forum Moderator
    PLi® Core member
  • 7,599 posts

+62
Good

Posted 12 August 2015 - 09:08

enigma2 will first try to read/write the cuts file at the location of the dvd itself. so if you have a writable filesystem wher the dvd is stored the cuts file will be aded to it, so it wo 't need to store the cuts file unser /home/root.

so that is the 'first try'
Geen wonder... Had slechts een dm7000, maar wel ook een rotor. eigenlijk al een tijdje ook een dm600 en dm7025. Maar nu kijkend met een et9000 en vuduo

Re: Playing off dvd.iso and resume. #9 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 12 August 2015 - 10:11

enigma2 will first try to read/write the cuts file at the location of the dvd itself. so if you have a writable filesystem wher the dvd is stored the cuts file will be aded to it, so it wo 't need to store the cuts file unser /home/root.

so that is the 'first try'

That indeed i first thaught, but .. it not the the case. I mean they check try to open dvd.cuts in directory : movie fiull path with filename.  with other words:

 

Wait I'm not such a good explainer :

 

My movie is for example located in /media/dvdiso/  path . the movie name is my_movie.iso  this means the m_ref.path.c_str() = "/media/dvdiso/my_movie.iso"

 

Then they try to open file /media/dvdiso/my_movie.iso/dvd.cuts   ? the path /media/dvdiso/my_movie.iso does not exist.

 

That's impossible what they are doeing the fopen() command can open create modifie a file put can not create a directory.

 

But why it is there now just to check if file is present ? I gues not since a bit further they used stat to perform such a check.

 

The only reason what I could think off is that another plugin such as cutlist editor my have created a path based on the location off movie and movie name ?? no even that impossible. You cant create a directory with filename from  an already existing file.

 

In my opinion it's actually does not make any sence att all.  Unless its maybe made if You use instead off a iso file a file directory containing the VIDEO_TS  with other words a mount  ?



Re: Playing off dvd.iso and resume. #10 mirakels

  • Forum Moderator
    PLi® Core member
  • 7,599 posts

+62
Good

Posted 12 August 2015 - 10:22

but it probably works for cases like /media/dvds/matrix3/video_ts
Geen wonder... Had slechts een dm7000, maar wel ook een rotor. eigenlijk al een tijdje ook een dm600 en dm7025. Maar nu kijkend met een et9000 en vuduo

Re: Playing off dvd.iso and resume. #11 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 12 August 2015 - 10:22

Yes that's it  :) 

 

In my opinion it's actually does not make any sence att all.  Unless its maybe made if You use instead off a iso file a file directory containing the VIDEO_TS

 

If I have extracted my dvd to a map  MY_MOVIE/VIDEO_TS  instead off a iso file ,

 

the dvd.cuts is made in MY_MOVIE  map  MY_MOVIE/dvd.cuts



Re: Playing off dvd.iso and resume. #12 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 12 August 2015 - 10:36

So the right complete code to avoid an empty file saving is :

	FILE* f;
	{
		std::string filename = m_ref.path;
		eDebug("[eServiceDVD] CVR test full path %s" , m_ref.path.c_str());
		filename += "/dvd.cuts";
		/* CVR We do not keep a resume file with position 0 */
		if (m_cue_pts == 0)
		{
			if (::access(filename.c_str(), F_OK) == 0)
				remove(filename.c_str());
			f = NULL;
		}
		else
			f = fopen(filename.c_str(), "wb");
	}
	if (f == NULL)
	{
		char filename[128];
		if ( m_ddvd_titlestring[0] != '\0' )
			snprintf(filename, sizeof(filename), "/home/root/dvd-%s.cuts", m_ddvd_titlestring);
		else
		{
			struct stat st;
			if (stat(m_ref.path.c_str(), &st) == 0)
			{
				// DVD has no name and cannot be written. Use the mtime to generate something unique...
				snprintf(filename, 128, "/home/root/dvd-%lx.cuts", st.st_mtime);
			}
			else
			{
				strcpy(filename, "/home/root/dvd-untitled.cuts");
			}
		}
		/* CVR We do not keep a resume file with position 0 */
		if (m_cue_pts == 0)
		{
			if (::access(filename, F_OK) == 0)
				remove(filename);
		}
		else
		{
			eDebug("[eServiceDVD] saveCuesheet filename=%s",filename);
			f = fopen(filename, "wb");
		}
	}

Then we cover all cases . We do not do a usseles fopen() .

We cover the iso file , the file case VIDEO_TS and we are taking care off the writable non writable location case.



Re: Playing off dvd.iso and resume. #13 littlesat

  • PLi® Core member
  • 56,273 posts

+691
Excellent

Posted 12 August 2015 - 10:43

For iso's I suggest it should be stored in the directory where we have the iso... so when the string ends with iso you can easily derive a different path..

 

I'm considering to remove my do not show resume patch when this could be improved...


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Playing off dvd.iso and resume. #14 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 12 August 2015 - 10:48

What perhaps can be done as extra is for the case it's an iso file creating a cuts file on same location as the iso file and naming it  iso filename stripped iso and added cuts instead off iso



Re: Playing off dvd.iso and resume. #15 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 12 August 2015 - 10:49

For iso's I suggest it should be stored in the directory where we have the iso... so when the string ends with iso you can easily derive a different path..

 

I'm considering to remove my do not show resume patch when this could be improved...

In many cases the place where iso files are located is non writable location.



Re: Playing off dvd.iso and resume. #16 littlesat

  • PLi® Core member
  • 56,273 posts

+691
Excellent

Posted 12 August 2015 - 14:45

In many cases the place where iso files are located is non writable location.

 

-> 

 

Then the only option is to but it e.g. in /home/root/.dvdcuts.... ;) just like gstreamer is doing it with the cache....


Edited by littlesat, 12 August 2015 - 14:45.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Playing off dvd.iso and resume. #17 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 12 August 2015 - 15:16

In many cases the place where iso files are located is non writable location.

 

-> 

 

Then the only option is to but it e.g. in /home/root/.dvdcuts.... ;) just like gstreamer is doing it with the cache....

That what we are doing.

 

In case it's a iso file it will always be in /home/root/dvd-<title or st.mimeuniqueid>.cuts

 

If it's a VIDEO_TS first we try to save the cut file under <location off VIDEO_TS directory>/dvd.cuts

if its unwritable it will be saved in

 

/home/root/dvd-<<title or st.mimeuniqueid>.cuts



Re: Playing off dvd.iso and resume. #18 athoik

  • PLi® Core member
  • 8,458 posts

+327
Excellent

Posted 12 August 2015 - 16:25

I guess @littlesat means to have only one file eg /home/root/.dvdcuts.
Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

Re: Playing off dvd.iso and resume. #19 mirakels

  • Forum Moderator
    PLi® Core member
  • 7,599 posts

+62
Good

Posted 12 August 2015 - 22:01

I think maybe in the old days only VIDEO_TS  (e.g. unpacked DVDS) were supported hens the simpe filename += "/dvd,cuts".

Today we also support .iso files so the code should be something like

 

if m_ref.path is a directory then

    filename += "/dvd.cuts"

else

    filename += ".cuts"

 

(don't forget to do a similar update in the function that locates and reads the cuts file)


Geen wonder... Had slechts een dm7000, maar wel ook een rotor. eigenlijk al een tijdje ook een dm600 en dm7025. Maar nu kijkend met een et9000 en vuduo

Re: Playing off dvd.iso and resume. #20 christophecvr

  • Senior Member
  • 3,131 posts

+140
Excellent

Posted 13 August 2015 - 02:10

I think maybe in the old days only VIDEO_TS  (e.g. unpacked DVDS) were supported hens the simpe filename += "/dvd,cuts".

Today we also support .iso files so the code should be something like

 

if m_ref.path is a directory then

    filename += "/dvd.cuts"

else

    filename += ".cuts"

 

(don't forget to do a similar update in the function that locates and reads the cuts file)

 

It's done.

 

The complete dvd resume is now fully operational.

 

If it's a live dvd resume position is kept in /home/root

If it's an iso file it's normally kept in location off iso file

If it's an file mode position is kep in base video map +/dvd.cuts

 

If the locations are not writable

resume file is kept in /home/root




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users