#1 Burning Software

It is currently Thu Dec 19, 2024 4:58 am

All times are UTC




Post new topic Reply to topic  [ 36 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject:
PostPosted: Sat Nov 12, 2005 12:29 pm 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
Good!

No. You need to allocate required amount of more. In your case you was just trashing the stack beyond allocated data (as you had less then required) and that was a problem.

raymng wrote:
I only changed the buffer to 100, the problem seems fixed.

UDF_TREE_ITEM l__UDF_TREE_ITEM__File[ 100 ];

> You need to calculate number of files you'll be using and allocate EXACT number of memory

Is it necessary to allocate EXACT number of memory ?
Any advantage over the allocating fixed number of memory? This approach seems working great so far (excluding this time).


Thanks.
raymng


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 12, 2005 12:34 pm 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
I guess you've just increased in on the stack and it results stack overflow (200 UDF_TREE_ITEMs are quite heavy for default settings).

Move this variable to global data region or use heap allocation of it (with operator "new" for example).

BTW, I've noticed you don't use IFO patching in your code. It would result not always playable DVDs (on hardware players). Please fix this as it would appear sooner or later.

raymng wrote:
I tried to increase the buffer to 200, but this will make the program crash.

raymng


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 12, 2005 12:56 pm 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
In your original case you've allocated UDF_TREE_ITEM array of 80 elements and did added 81 file. Also keep in mind first item is reserved for chain head. 82 elements Vs 80 allocated total. So you've used two extra elements you did not allocate. If was not resulting hard crash (there were some data on the stack after all) but passed data was mangled. That was the source of your problem :)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 12, 2005 2:53 pm 
Offline

Joined: Mon Jun 06, 2005 1:47 pm
Posts: 53
Thanks for your detailed explanation.

> Move this variable to global data region or use heap allocation of it (with operator "new" for example).

If I move the variable to global, it won't crash even I allocate 200 ?

>BTW, I've noticed you don't use IFO patching in your code. It would result not always playable DVDs (on hardware players). Please fix this as it would appear sooner or later.

IFO patching? Can you show me an sample codes ? or if the new version will include the sample, when will it be available ?


Thanks.
raymng


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 12, 2005 2:57 pm 
Offline

Joined: Mon Jun 06, 2005 1:47 pm
Posts: 53
From the email:

> good idea would be - allocate required amout of memory so far... B/s even extra large array would be overflowing in some case.

so if I move the variable to global, will it still cause the overflowing issue ?

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 12, 2005 7:16 pm 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
See... It's you who knows how many files you process and not we. So please allocate enough memory for operations. Is it a very big problem to calculate total number of files you'd be creating UDF image from and do

new [ number_of_files_to_allocate ] UDF_TREE_ITEM

call? I don't understand...

raymng wrote:
From the email:

> good idea would be - allocate required amout of memory so far... B/s even extra large array would be overflowing in some case.

so if I move the variable to global, will it still cause the overflowing issue ?

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 13, 2005 1:58 am 
Offline

Joined: Mon Jun 06, 2005 1:47 pm
Posts: 53
> Is it a very big problem to calculate total number of files you'd be creating UDF image

No, it is not a big problem. But if I move the variable to global, then the overflowing issue will be gone forever... I think it is worth to do it. Do you think so ?

>BTW, I've noticed you don't use IFO patching in your code. It would result not always playable DVDs (on hardware players). Please fix this as it would appear sooner or later.

What do you mean by "IFO patching" ? Can you show me an sample codes ? or if the new version will include this sample ?


Thanks
raymng


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 13, 2005 2:05 am 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
1) Even if you'd move the variable to global one there would be one day when you'll add more then 200 files. And your app would crash.

In any case - I've pointed to the problem and described what you've did wrong. Also I've pointed how to fix it. It's up to you what to do with your code.

2) Check DVDVideoTrackAtOnceFromTree sample. It shows how to patch IFO/BUP files. Failing to do this would result not always playable DVDs.

raymng wrote:
> Is it a very big problem to calculate total number of files you'd be creating UDF image

No, it is not a big problem. But if I move the variable to global, then the overflowing issue will be gone forever... I think it is worth to do it. Do you think so ?

>BTW, I've noticed you don't use IFO patching in your code. It would result not always playable DVDs (on hardware players). Please fix this as it would appear sooner or later.

What do you mean by "IFO patching" ? Can you show me an sample codes ? or if the new version will include this sample ?


Thanks
raymng


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 13, 2005 2:12 am 
Offline

Joined: Mon Jun 06, 2005 1:47 pm
Posts: 53
1. Yes, I understand. Thanks so much for your help. You have been very helpful already. :P

2. Okay, I will check it out. :twisted:


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 13, 2005 8:45 am 
Offline

Joined: Mon Jun 06, 2005 1:47 pm
Posts: 53
It should be "new [ number_of_files_to_allocate + 1 ] UDF_TREE_ITEM" because of the chain head, right ?


Regarding the IFO patching, I found this thread in the forum:
http://rocketdivision.com/forum/viewtop ... 61767a4d6b

Quote:
If you have DVD-Video authoring software which does not place files in the right order and inserts "gaps" info offsets you'll have to patch IFO files so they would contain relative LBA offsets identical to UDF LBA on the disc

In a nutshell: if you don't use DVD-Video recording or you have no problems with DVD-Video disc playability in hardware DVD players - don't touch this API calls. That's why we don't document them.


Actually I am not sure if the files has been placed in the right order or not, will it harm if I call StarBurn_UDF_PatchIfoHeader() and StarBurn_UDF_PatchIfoTable() all the time ?

Thanks again!

raymng


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 13, 2005 9:49 am 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
1) Yes, exactly!

2) Just follow the sample and read the comments within it. Quite a lot of people did not follow the sample stuff and get incompatible DVDs. We'll be rewriting this API (create some sort of the template) but it would not be tomorrow so I'm strongly recommending you to fix your code. "For your own safety!" (c) ...

raymng wrote:
It should be "new [ number_of_files_to_allocate + 1 ] UDF_TREE_ITEM" because of the chain head, right ?


Regarding the IFO patching, I found this thread in the forum:
http://rocketdivision.com/forum/viewtop ... 61767a4d6b

Quote:
If you have DVD-Video authoring software which does not place files in the right order and inserts "gaps" info offsets you'll have to patch IFO files so they would contain relative LBA offsets identical to UDF LBA on the disc

In a nutshell: if you don't use DVD-Video recording or you have no problems with DVD-Video disc playability in hardware DVD players - don't touch this API calls. That's why we don't document them.


Actually I am not sure if the files has been placed in the right order or not, will it harm if I call StarBurn_UDF_PatchIfoHeader() and StarBurn_UDF_PatchIfoTable() all the time ?

Thanks again!

raymng


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 13, 2005 10:04 am 
Offline

Joined: Mon Jun 06, 2005 1:47 pm
Posts: 53
Quote:
In a nutshell: if you don't use DVD-Video recording or you have no problems with DVD-Video disc playability in hardware DVD players - don't touch this API calls. That's why we don't document them.


As you mentioned "don't touch this API calls", I worry it will harm the DVD if I call "StarBurn_UDF_PatchIfoHeader()" and "StarBurn_UDF_PatchIfoTable()" even if it is not necessary.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 13, 2005 10:16 am 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
However you do use DVD-Video recording and you do have problems with playability (using DVD authoring software aligning IFO/BUP files with non-zero offset). Or was it another Raymond? :)

raymng wrote:
Quote:
In a nutshell: if you don't use DVD-Video recording or you have no problems with DVD-Video disc playability in hardware DVD players - don't touch this API calls. That's why we don't document them.


As you mentioned "don't touch this API calls", I worry it will harm the DVD if I call "StarBurn_UDF_PatchIfoHeader()" and "StarBurn_UDF_PatchIfoTable()" even if it is not necessary.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 13, 2005 10:33 am 
Offline

Joined: Mon Jun 06, 2005 1:47 pm
Posts: 53
Quote:
However you do use DVD-Video recording and you do have problems with playability (using DVD authoring software aligning IFO/BUP files with non-zero offset). Or was it another Raymond?


Confusing... :? yes I use DVD-Video recording, but "aligning IFO/BUP files" ??
How did that "Raymond" contact you before ?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 13, 2005 10:55 am 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
He has another second name... Too many of you around :)

raymng wrote:
Quote:
However you do use DVD-Video recording and you do have problems with playability (using DVD authoring software aligning IFO/BUP files with non-zero offset). Or was it another Raymond?


Confusing... :? yes I use DVD-Video recording, but "aligning IFO/BUP files" ??
How did that "Raymond" contact you before ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 36 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 51 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group