Lines 17-23
Link Here
|
17 |
along with this program; if not, write to the Free Software |
17 |
along with this program; if not, write to the Free Software |
18 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 |
*/ |
19 |
*/ |
20 |
|
20 |
|
21 |
#ifdef HAVE_CONFIG_H |
21 |
#ifdef HAVE_CONFIG_H |
22 |
# include "config.h" |
22 |
# include "config.h" |
23 |
#endif |
23 |
#endif |
Lines 28-33
Link Here
|
28 |
#include <ctype.h> |
28 |
#include <ctype.h> |
29 |
#include <math.h> |
29 |
#include <math.h> |
30 |
|
30 |
|
|
|
31 |
#define _VCD_INFO_PRIVATE_H |
32 |
/* We don't want to pull in cdio's config */ |
33 |
#define __CDIO_CONFIG_H__ |
31 |
#include <cdio/cdio.h> |
34 |
#include <cdio/cdio.h> |
32 |
#include <cdio/util.h> |
35 |
#include <cdio/util.h> |
33 |
#include <cdio/iso9660.h> |
36 |
#include <cdio/iso9660.h> |
Lines 92-98
Link Here
|
92 |
CdioListNode_t *node2; |
95 |
CdioListNode_t *node2; |
93 |
|
96 |
|
94 |
/* default entry point */ |
97 |
/* default entry point */ |
95 |
if (_sequence->default_entry_id |
98 |
if (_sequence->default_entry_id |
96 |
&& !strcmp (entry_id, _sequence->default_entry_id)) |
99 |
&& !strcmp (entry_id, _sequence->default_entry_id)) |
97 |
return _sequence; |
100 |
return _sequence; |
98 |
|
101 |
|
Lines 101-107
Link Here
|
101 |
{ |
104 |
{ |
102 |
entry_t *_entry = _cdio_list_node_data (node2); |
105 |
entry_t *_entry = _cdio_list_node_data (node2); |
103 |
|
106 |
|
104 |
if (_entry->id |
107 |
if (_entry->id |
105 |
&& !strcmp (entry_id, _entry->id)) |
108 |
&& !strcmp (entry_id, _entry->id)) |
106 |
return _sequence; |
109 |
return _sequence; |
107 |
} |
110 |
} |
Lines 240-256
Link Here
|
240 |
|
243 |
|
241 |
/* |
244 |
/* |
242 |
* public methods |
245 |
* public methods |
243 |
*/ |
246 |
*/ |
244 |
|
247 |
|
245 |
VcdObj_t * |
248 |
VcdObj_t * |
246 |
vcd_obj_new (vcd_type_t vcd_type) |
249 |
vcd_obj_new (vcd_type_t vcd_type) |
247 |
{ |
250 |
{ |
248 |
VcdObj_t *p_new_obj = NULL; |
251 |
VcdObj_t *p_new_obj = NULL; |
249 |
static bool _first = true; |
252 |
static bool _first = true; |
250 |
|
253 |
|
251 |
if (_first) |
254 |
if (_first) |
252 |
{ |
255 |
{ |
253 |
#if defined(_DEVELOPMENT_) |
256 |
#if defined(_DEVELOPMENT_) |
254 |
vcd_warn ("initializing libvcd %s [%s]", VERSION, HOST_ARCH); |
257 |
vcd_warn ("initializing libvcd %s [%s]", VERSION, HOST_ARCH); |
255 |
vcd_warn (" "); |
258 |
vcd_warn (" "); |
256 |
vcd_warn (" this is the Beta development branch!"); |
259 |
vcd_warn (" this is the Beta development branch!"); |
Lines 297-305
Link Here
|
297 |
/* gap's defined by IEC-10149 / ECMA-130 */ |
300 |
/* gap's defined by IEC-10149 / ECMA-130 */ |
298 |
|
301 |
|
299 |
/* pre-gap's for tracks but the first one */ |
302 |
/* pre-gap's for tracks but the first one */ |
300 |
p_new_obj->track_pregap = CDIO_PREGAP_SECTORS; |
303 |
p_new_obj->track_pregap = CDIO_PREGAP_SECTORS; |
301 |
/* post-gap after last track */ |
304 |
/* post-gap after last track */ |
302 |
p_new_obj->leadout_pregap = CDIO_POSTGAP_SECTORS; |
305 |
p_new_obj->leadout_pregap = CDIO_POSTGAP_SECTORS; |
303 |
|
306 |
|
304 |
if (_vcd_obj_has_cap_p (p_new_obj, _CAP_TRACK_MARGINS)) |
307 |
if (_vcd_obj_has_cap_p (p_new_obj, _CAP_TRACK_MARGINS)) |
305 |
{ |
308 |
{ |
Lines 315-321
Link Here
|
315 |
return p_new_obj; |
318 |
return p_new_obj; |
316 |
} |
319 |
} |
317 |
|
320 |
|
318 |
int |
321 |
int |
319 |
vcd_obj_remove_item (VcdObj_t *p_vcdobj, const char id[]) |
322 |
vcd_obj_remove_item (VcdObj_t *p_vcdobj, const char id[]) |
320 |
{ |
323 |
{ |
321 |
vcd_warn ("vcd_obj_remove_item('%s') not implemented yet!", id); |
324 |
vcd_warn ("vcd_obj_remove_item('%s') not implemented yet!", id); |
Lines 333-339
Link Here
|
333 |
vcd_assert (track_id >= 0); |
336 |
vcd_assert (track_id >= 0); |
334 |
|
337 |
|
335 |
node = _vcd_list_at (p_vcdobj->mpeg_sequence_list, track_id); |
338 |
node = _vcd_list_at (p_vcdobj->mpeg_sequence_list, track_id); |
336 |
|
339 |
|
337 |
vcd_assert (node != NULL); |
340 |
vcd_assert (node != NULL); |
338 |
|
341 |
|
339 |
track = (mpeg_sequence_t *) _cdio_list_node_data (node); |
342 |
track = (mpeg_sequence_t *) _cdio_list_node_data (node); |
Lines 341-365
Link Here
|
341 |
vcd_mpeg_source_destroy (track->source, true); |
344 |
vcd_mpeg_source_destroy (track->source, true); |
342 |
|
345 |
|
343 |
length = track->info ? track->info->packets : 0; |
346 |
length = track->info ? track->info->packets : 0; |
344 |
length += p_vcdobj->track_pregap + p_vcdobj->track_front_margin |
347 |
length += p_vcdobj->track_pregap + p_vcdobj->track_front_margin |
345 |
+ 0 + p_vcdobj->track_rear_margin; |
348 |
+ 0 + p_vcdobj->track_rear_margin; |
346 |
|
349 |
|
347 |
/* fixup offsets */ |
350 |
/* fixup offsets */ |
348 |
{ |
351 |
{ |
349 |
CdioListNode_t *node2 = node; |
352 |
CdioListNode_t *node2 = node; |
350 |
while ((node2 = _cdio_list_node_next (node2)) != NULL) |
353 |
while ((node2 = _cdio_list_node_next (node2)) != NULL) |
351 |
((mpeg_sequence_t *) _cdio_list_node_data (node))->relative_start_extent |
354 |
((mpeg_sequence_t *) _cdio_list_node_data (node))->relative_start_extent |
352 |
-= length; |
355 |
-= length; |
353 |
} |
356 |
} |
354 |
|
357 |
|
355 |
p_vcdobj->relative_end_extent -= length; |
358 |
p_vcdobj->relative_end_extent -= length; |
356 |
|
359 |
|
357 |
/* shift up */ |
360 |
/* shift up */ |
358 |
_cdio_list_node_free (node, true); |
361 |
_cdio_list_node_free (node, true, NULL); |
359 |
} |
362 |
} |
360 |
|
363 |
|
361 |
int |
364 |
int |
362 |
vcd_obj_append_segment_play_item (VcdObj_t *p_vcdobj, |
365 |
vcd_obj_append_segment_play_item (VcdObj_t *p_vcdobj, |
363 |
VcdMpegSource_t *p_mpeg_source, |
366 |
VcdMpegSource_t *p_mpeg_source, |
364 |
const char item_id[]) |
367 |
const char item_id[]) |
365 |
{ |
368 |
{ |
Lines 386-392
Link Here
|
386 |
return -1; |
389 |
return -1; |
387 |
} |
390 |
} |
388 |
|
391 |
|
389 |
vcd_info ("scanning mpeg segment item #%d for scanpoints...", |
392 |
vcd_info ("scanning mpeg segment item #%d for scanpoints...", |
390 |
_cdio_list_length (p_vcdobj->mpeg_segment_list)); |
393 |
_cdio_list_length (p_vcdobj->mpeg_segment_list)); |
391 |
|
394 |
|
392 |
vcd_mpeg_source_scan (p_mpeg_source, !p_vcdobj->relaxed_aps, |
395 |
vcd_mpeg_source_scan (p_mpeg_source, !p_vcdobj->relaxed_aps, |
Lines 405-411
Link Here
|
405 |
segment->source = p_mpeg_source; |
408 |
segment->source = p_mpeg_source; |
406 |
|
409 |
|
407 |
segment->id = strdup (item_id); |
410 |
segment->id = strdup (item_id); |
408 |
|
411 |
|
409 |
segment->info = vcd_mpeg_source_get_info (p_mpeg_source); |
412 |
segment->info = vcd_mpeg_source_get_info (p_mpeg_source); |
410 |
segment->segment_count = _vcd_len2blocks (segment->info->packets, 150); |
413 |
segment->segment_count = _vcd_len2blocks (segment->info->packets, 150); |
411 |
|
414 |
|
Lines 421-427
Link Here
|
421 |
} |
424 |
} |
422 |
|
425 |
|
423 |
int |
426 |
int |
424 |
vcd_obj_append_sequence_play_item (VcdObj_t *p_vcdobj, |
427 |
vcd_obj_append_sequence_play_item (VcdObj_t *p_vcdobj, |
425 |
VcdMpegSource_t *p_mpeg_source, |
428 |
VcdMpegSource_t *p_mpeg_source, |
426 |
const char item_id[], |
429 |
const char item_id[], |
427 |
const char default_entry_id[]) |
430 |
const char default_entry_id[]) |
Lines 464-470
Link Here
|
464 |
|
467 |
|
465 |
if (default_entry_id) |
468 |
if (default_entry_id) |
466 |
sequence->default_entry_id = strdup (default_entry_id); |
469 |
sequence->default_entry_id = strdup (default_entry_id); |
467 |
|
470 |
|
468 |
sequence->info = vcd_mpeg_source_get_info (p_mpeg_source); |
471 |
sequence->info = vcd_mpeg_source_get_info (p_mpeg_source); |
469 |
length = sequence->info->packets; |
472 |
length = sequence->info->packets; |
470 |
|
473 |
|
Lines 474-480
Link Here
|
474 |
p_vcdobj->relative_end_extent += p_vcdobj->track_pregap; |
477 |
p_vcdobj->relative_end_extent += p_vcdobj->track_pregap; |
475 |
sequence->relative_start_extent = p_vcdobj->relative_end_extent; |
478 |
sequence->relative_start_extent = p_vcdobj->relative_end_extent; |
476 |
|
479 |
|
477 |
p_vcdobj->relative_end_extent += p_vcdobj->track_front_margin + length |
480 |
p_vcdobj->relative_end_extent += p_vcdobj->track_front_margin + length |
478 |
+ p_vcdobj->track_rear_margin; |
481 |
+ p_vcdobj->track_rear_margin; |
479 |
|
482 |
|
480 |
/* sanity checks */ |
483 |
/* sanity checks */ |
Lines 511-523
Link Here
|
511 |
vcd_warn ("audio stream #%d not supported by this VCD type", i); |
514 |
vcd_warn ("audio stream #%d not supported by this VCD type", i); |
512 |
|
515 |
|
513 |
if (sequence->info->ahdr[i].sampfreq != 44100) |
516 |
if (sequence->info->ahdr[i].sampfreq != 44100) |
514 |
vcd_warn ("audio stream #%d has sampling frequency %d Hz (should be 44100 Hz)", |
517 |
vcd_warn ("audio stream #%d has sampling frequency %d Hz (should be 44100 Hz)", |
515 |
i, sequence->info->ahdr[i].sampfreq); |
518 |
i, sequence->info->ahdr[i].sampfreq); |
516 |
|
519 |
|
517 |
if (sequence->info->ahdr[i].layer != 2) |
520 |
if (sequence->info->ahdr[i].layer != 2) |
518 |
vcd_warn ("audio stream #%d is not layer II", i); |
521 |
vcd_warn ("audio stream #%d is not layer II", i); |
519 |
|
522 |
|
520 |
if (_vcd_obj_has_cap_p (p_vcdobj, _CAP_MPEG1) |
523 |
if (_vcd_obj_has_cap_p (p_vcdobj, _CAP_MPEG1) |
521 |
&& sequence->info->ahdr[i].bitrate != 224*1024) |
524 |
&& sequence->info->ahdr[i].bitrate != 224*1024) |
522 |
vcd_warn ("audio stream #%d has bitrate %d kbps (should be 224 kbps for this vcd type)", |
525 |
vcd_warn ("audio stream #%d has bitrate %d kbps (should be 224 kbps for this vcd type)", |
523 |
i, sequence->info->ahdr[i].bitrate); |
526 |
i, sequence->info->ahdr[i].bitrate); |
Lines 528-534
Link Here
|
528 |
} |
531 |
} |
529 |
} |
532 |
} |
530 |
} |
533 |
} |
531 |
|
534 |
|
532 |
/* vcd_debug ("track# %d's detected playing time: %.2f seconds", */ |
535 |
/* vcd_debug ("track# %d's detected playing time: %.2f seconds", */ |
533 |
/* track_no, sequence->info->playing_time); */ |
536 |
/* track_no, sequence->info->playing_time); */ |
534 |
|
537 |
|
Lines 549-556
Link Here
|
549 |
return 0; |
552 |
return 0; |
550 |
} |
553 |
} |
551 |
|
554 |
|
552 |
int |
555 |
int |
553 |
vcd_obj_add_sequence_pause (VcdObj_t *obj, const char sequence_id[], |
556 |
vcd_obj_add_sequence_pause (VcdObj_t *obj, const char sequence_id[], |
554 |
double pause_time, const char pause_id[]) |
557 |
double pause_time, const char pause_id[]) |
555 |
{ |
558 |
{ |
556 |
mpeg_sequence_t *p_sequence; |
559 |
mpeg_sequence_t *p_sequence; |
Lines 560-566
Link Here
|
560 |
if (sequence_id) |
563 |
if (sequence_id) |
561 |
p_sequence = _vcd_obj_get_sequence_by_id (obj, sequence_id); |
564 |
p_sequence = _vcd_obj_get_sequence_by_id (obj, sequence_id); |
562 |
else |
565 |
else |
563 |
p_sequence = |
566 |
p_sequence = |
564 |
_cdio_list_node_data (_cdio_list_end (obj->mpeg_sequence_list)); |
567 |
_cdio_list_node_data (_cdio_list_end (obj->mpeg_sequence_list)); |
565 |
|
568 |
|
566 |
if (!p_sequence) |
569 |
if (!p_sequence) |
Lines 582-588
Link Here
|
582 |
_cdio_list_append (p_sequence->pause_list, _pause); |
585 |
_cdio_list_append (p_sequence->pause_list, _pause); |
583 |
} |
586 |
} |
584 |
|
587 |
|
585 |
_vcd_list_sort (p_sequence->pause_list, |
588 |
_vcd_list_sort (p_sequence->pause_list, |
586 |
(_cdio_list_cmp_func_t) _pause_cmp); |
589 |
(_cdio_list_cmp_func_t) _pause_cmp); |
587 |
|
590 |
|
588 |
vcd_debug ("added autopause point at %f", pause_time); |
591 |
vcd_debug ("added autopause point at %f", pause_time); |
Lines 590-597
Link Here
|
590 |
return 0; |
593 |
return 0; |
591 |
} |
594 |
} |
592 |
|
595 |
|
593 |
int |
596 |
int |
594 |
vcd_obj_add_segment_pause (VcdObj_t *p_obj, const char segment_id[], |
597 |
vcd_obj_add_segment_pause (VcdObj_t *p_obj, const char segment_id[], |
595 |
double pause_time, const char pause_id[]) |
598 |
double pause_time, const char pause_id[]) |
596 |
{ |
599 |
{ |
597 |
mpeg_segment_t *_segment; |
600 |
mpeg_segment_t *_segment; |
Lines 622-628
Link Here
|
622 |
_cdio_list_append (_segment->pause_list, _pause); |
625 |
_cdio_list_append (_segment->pause_list, _pause); |
623 |
} |
626 |
} |
624 |
|
627 |
|
625 |
_vcd_list_sort (_segment->pause_list, |
628 |
_vcd_list_sort (_segment->pause_list, |
626 |
(_cdio_list_cmp_func_t) _pause_cmp); |
629 |
(_cdio_list_cmp_func_t) _pause_cmp); |
627 |
|
630 |
|
628 |
vcd_debug ("added autopause point at %f", pause_time); |
631 |
vcd_debug ("added autopause point at %f", pause_time); |
Lines 642-649
Link Here
|
642 |
return 0; |
645 |
return 0; |
643 |
} |
646 |
} |
644 |
|
647 |
|
645 |
int |
648 |
int |
646 |
vcd_obj_add_sequence_entry (VcdObj_t *p_obj, const char sequence_id[], |
649 |
vcd_obj_add_sequence_entry (VcdObj_t *p_obj, const char sequence_id[], |
647 |
double entry_time, const char entry_id[]) |
650 |
double entry_time, const char entry_id[]) |
648 |
{ |
651 |
{ |
649 |
mpeg_sequence_t *p_sequence; |
652 |
mpeg_sequence_t *p_sequence; |
Lines 684-696
Link Here
|
684 |
_cdio_list_append (p_sequence->entry_list, _entry); |
687 |
_cdio_list_append (p_sequence->entry_list, _entry); |
685 |
} |
688 |
} |
686 |
|
689 |
|
687 |
_vcd_list_sort (p_sequence->entry_list, |
690 |
_vcd_list_sort (p_sequence->entry_list, |
688 |
(_cdio_list_cmp_func_t) _entry_cmp); |
691 |
(_cdio_list_cmp_func_t) _entry_cmp); |
689 |
|
692 |
|
690 |
return 0; |
693 |
return 0; |
691 |
} |
694 |
} |
692 |
|
695 |
|
693 |
void |
696 |
void |
694 |
vcd_obj_destroy (VcdObj_t *p_obj) |
697 |
vcd_obj_destroy (VcdObj_t *p_obj) |
695 |
{ |
698 |
{ |
696 |
CdioListNode_t *p_node; |
699 |
CdioListNode_t *p_node; |
Lines 704-736
Link Here
|
704 |
_CDIO_LIST_FOREACH (p_node, p_obj->custom_file_list) |
707 |
_CDIO_LIST_FOREACH (p_node, p_obj->custom_file_list) |
705 |
{ |
708 |
{ |
706 |
custom_file_t *p = _cdio_list_node_data (p_node); |
709 |
custom_file_t *p = _cdio_list_node_data (p_node); |
707 |
|
710 |
|
708 |
free (p->iso_pathname); |
711 |
free (p->iso_pathname); |
709 |
} |
712 |
} |
710 |
|
713 |
|
711 |
_cdio_list_free (p_obj->custom_file_list, true); |
714 |
_cdio_list_free (p_obj->custom_file_list, true, NULL); |
712 |
|
715 |
|
713 |
_cdio_list_free (p_obj->custom_dir_list, true); |
716 |
_cdio_list_free (p_obj->custom_dir_list, true, NULL); |
714 |
|
717 |
|
715 |
while (_cdio_list_length (p_obj->mpeg_sequence_list)) |
718 |
while (_cdio_list_length (p_obj->mpeg_sequence_list)) |
716 |
_vcd_obj_remove_mpeg_track (p_obj, 0); |
719 |
_vcd_obj_remove_mpeg_track (p_obj, 0); |
717 |
_cdio_list_free (p_obj->mpeg_sequence_list, true); |
720 |
_cdio_list_free (p_obj->mpeg_sequence_list, true, NULL); |
718 |
|
721 |
|
719 |
free (p_obj); |
722 |
free (p_obj); |
720 |
} |
723 |
} |
721 |
|
724 |
|
722 |
int |
725 |
int |
723 |
vcd_obj_set_param_uint (VcdObj_t *p_obj, vcd_parm_t param, unsigned arg) |
726 |
vcd_obj_set_param_uint (VcdObj_t *p_obj, vcd_parm_t param, unsigned arg) |
724 |
{ |
727 |
{ |
725 |
vcd_assert (p_obj != NULL); |
728 |
vcd_assert (p_obj != NULL); |
726 |
|
729 |
|
727 |
switch (param) |
730 |
switch (param) |
728 |
{ |
731 |
{ |
729 |
case VCD_PARM_VOLUME_COUNT: |
732 |
case VCD_PARM_VOLUME_COUNT: |
730 |
p_obj->info_volume_count = arg; |
733 |
p_obj->info_volume_count = arg; |
731 |
if (!IN (p_obj->info_volume_count, 1, 65535)) |
734 |
if (!IN (p_obj->info_volume_count, 1, 65535)) |
732 |
{ |
735 |
{ |
733 |
p_obj->info_volume_count = |
736 |
p_obj->info_volume_count = |
734 |
CLAMP (p_obj->info_volume_count, 1, 65535); |
737 |
CLAMP (p_obj->info_volume_count, 1, 65535); |
735 |
vcd_warn ("volume count out of range, clamping to range"); |
738 |
vcd_warn ("volume count out of range, clamping to range"); |
736 |
} |
739 |
} |
Lines 741-747
Link Here
|
741 |
p_obj->info_volume_number = arg; |
744 |
p_obj->info_volume_number = arg; |
742 |
if (!IN (p_obj->info_volume_number, 0, 65534)) |
745 |
if (!IN (p_obj->info_volume_number, 0, 65534)) |
743 |
{ |
746 |
{ |
744 |
p_obj->info_volume_number = |
747 |
p_obj->info_volume_number = |
745 |
CLAMP (p_obj->info_volume_number, 0, 65534); |
748 |
CLAMP (p_obj->info_volume_number, 0, 65534); |
746 |
vcd_warn ("volume number out of range, clamping to range"); |
749 |
vcd_warn ("volume number out of range, clamping to range"); |
747 |
} |
750 |
} |
Lines 767-773
Link Here
|
767 |
} |
770 |
} |
768 |
if (p_obj->leadout_pregap < CDIO_PREGAP_SECTORS) |
771 |
if (p_obj->leadout_pregap < CDIO_PREGAP_SECTORS) |
769 |
vcd_warn ("track leadout pregap set below %d sectors; " |
772 |
vcd_warn ("track leadout pregap set below %d sectors; " |
770 |
"created (S)VCD may be non-working", |
773 |
"created (S)VCD may be non-working", |
771 |
CDIO_PREGAP_SECTORS); |
774 |
CDIO_PREGAP_SECTORS); |
772 |
|
775 |
|
773 |
vcd_debug ("changed leadout pregap to %u", p_obj->leadout_pregap); |
776 |
vcd_debug ("changed leadout pregap to %u", p_obj->leadout_pregap); |
Lines 782-788
Link Here
|
782 |
} |
785 |
} |
783 |
if (p_obj->track_pregap < CDIO_PREGAP_SECTORS) |
786 |
if (p_obj->track_pregap < CDIO_PREGAP_SECTORS) |
784 |
vcd_warn ("track pre gap set below %d sectors; " |
787 |
vcd_warn ("track pre gap set below %d sectors; " |
785 |
"created (S)VCD may be non-working", |
788 |
"created (S)VCD may be non-working", |
786 |
CDIO_PREGAP_SECTORS); |
789 |
CDIO_PREGAP_SECTORS); |
787 |
vcd_debug ("changed track pregap to %u", p_obj->track_pregap); |
790 |
vcd_debug ("changed track pregap to %u", p_obj->track_pregap); |
788 |
break; |
791 |
break; |
Lines 791-801
Link Here
|
791 |
p_obj->track_front_margin = arg; |
794 |
p_obj->track_front_margin = arg; |
792 |
if (!IN (p_obj->track_front_margin, 0, CDIO_PREGAP_SECTORS)) |
795 |
if (!IN (p_obj->track_front_margin, 0, CDIO_PREGAP_SECTORS)) |
793 |
{ |
796 |
{ |
794 |
p_obj->track_front_margin = CLAMP (p_obj->track_front_margin, 0, |
797 |
p_obj->track_front_margin = CLAMP (p_obj->track_front_margin, 0, |
795 |
CDIO_PREGAP_SECTORS); |
798 |
CDIO_PREGAP_SECTORS); |
796 |
vcd_warn ("front margin out of range, clamping to allowed range"); |
799 |
vcd_warn ("front margin out of range, clamping to allowed range"); |
797 |
} |
800 |
} |
798 |
if (_vcd_obj_has_cap_p (p_obj, _CAP_TRACK_MARGINS) |
801 |
if (_vcd_obj_has_cap_p (p_obj, _CAP_TRACK_MARGINS) |
799 |
&& p_obj->track_front_margin < 15) |
802 |
&& p_obj->track_front_margin < 15) |
800 |
vcd_warn ("front margin set smaller than recommended (%d < 15 sectors) for disc type used", |
803 |
vcd_warn ("front margin set smaller than recommended (%d < 15 sectors) for disc type used", |
801 |
p_obj->track_front_margin); |
804 |
p_obj->track_front_margin); |
Lines 807-817
Link Here
|
807 |
p_obj->track_rear_margin = arg; |
810 |
p_obj->track_rear_margin = arg; |
808 |
if (!IN (p_obj->track_rear_margin, 0, CDIO_POSTGAP_SECTORS)) |
811 |
if (!IN (p_obj->track_rear_margin, 0, CDIO_POSTGAP_SECTORS)) |
809 |
{ |
812 |
{ |
810 |
p_obj->track_rear_margin = CLAMP (p_obj->track_rear_margin, 0, |
813 |
p_obj->track_rear_margin = CLAMP (p_obj->track_rear_margin, 0, |
811 |
CDIO_POSTGAP_SECTORS); |
814 |
CDIO_POSTGAP_SECTORS); |
812 |
vcd_warn ("rear margin out of range, clamping to allowed range"); |
815 |
vcd_warn ("rear margin out of range, clamping to allowed range"); |
813 |
} |
816 |
} |
814 |
if (_vcd_obj_has_cap_p (p_obj, _CAP_TRACK_MARGINS) |
817 |
if (_vcd_obj_has_cap_p (p_obj, _CAP_TRACK_MARGINS) |
815 |
&& p_obj->track_rear_margin < 15) |
818 |
&& p_obj->track_rear_margin < 15) |
816 |
vcd_warn ("rear margin set smaller than recommended (%d < 15 sectors) for disc type used", |
819 |
vcd_warn ("rear margin set smaller than recommended (%d < 15 sectors) for disc type used", |
817 |
p_obj->track_rear_margin); |
820 |
p_obj->track_rear_margin); |
Lines 826-838
Link Here
|
826 |
return 0; |
829 |
return 0; |
827 |
} |
830 |
} |
828 |
|
831 |
|
829 |
int |
832 |
int |
830 |
vcd_obj_set_param_str (VcdObj_t *p_obj, vcd_parm_t param, const char *arg) |
833 |
vcd_obj_set_param_str (VcdObj_t *p_obj, vcd_parm_t param, const char *arg) |
831 |
{ |
834 |
{ |
832 |
vcd_assert (p_obj != NULL); |
835 |
vcd_assert (p_obj != NULL); |
833 |
vcd_assert (arg != NULL); |
836 |
vcd_assert (arg != NULL); |
834 |
|
837 |
|
835 |
switch (param) |
838 |
switch (param) |
836 |
{ |
839 |
{ |
837 |
case VCD_PARM_VOLUME_ID: |
840 |
case VCD_PARM_VOLUME_ID: |
838 |
free (p_obj->iso_volume_label); |
841 |
free (p_obj->iso_volume_label); |
Lines 877-883
Link Here
|
877 |
} |
880 |
} |
878 |
vcd_debug ("changed application id to `%s'", p_obj->iso_application_id); |
881 |
vcd_debug ("changed application id to `%s'", p_obj->iso_application_id); |
879 |
break; |
882 |
break; |
880 |
|
883 |
|
881 |
case VCD_PARM_ALBUM_ID: |
884 |
case VCD_PARM_ALBUM_ID: |
882 |
free (p_obj->info_album_id); |
885 |
free (p_obj->info_album_id); |
883 |
p_obj->info_album_id = strdup (arg); |
886 |
p_obj->info_album_id = strdup (arg); |
Lines 897-908
Link Here
|
897 |
return 0; |
900 |
return 0; |
898 |
} |
901 |
} |
899 |
|
902 |
|
900 |
int |
903 |
int |
901 |
vcd_obj_set_param_bool (VcdObj_t *p_obj, vcd_parm_t param, bool arg) |
904 |
vcd_obj_set_param_bool (VcdObj_t *p_obj, vcd_parm_t param, bool arg) |
902 |
{ |
905 |
{ |
903 |
vcd_assert (p_obj != NULL); |
906 |
vcd_assert (p_obj != NULL); |
904 |
|
907 |
|
905 |
switch (param) |
908 |
switch (param) |
906 |
{ |
909 |
{ |
907 |
case VCD_PARM_RELAXED_APS: |
910 |
case VCD_PARM_RELAXED_APS: |
908 |
p_obj->relaxed_aps = arg ? true : false; |
911 |
p_obj->relaxed_aps = arg ? true : false; |
Lines 911-923
Link Here
|
911 |
|
914 |
|
912 |
case VCD_PARM_NEXT_VOL_LID2: |
915 |
case VCD_PARM_NEXT_VOL_LID2: |
913 |
p_obj->info_use_lid2 = arg ? true : false; |
916 |
p_obj->info_use_lid2 = arg ? true : false; |
914 |
vcd_debug ("changing 'next volume use lid 2' to %d", |
917 |
vcd_debug ("changing 'next volume use lid 2' to %d", |
915 |
p_obj->info_use_lid2); |
918 |
p_obj->info_use_lid2); |
916 |
break; |
919 |
break; |
917 |
|
920 |
|
918 |
case VCD_PARM_NEXT_VOL_SEQ2: |
921 |
case VCD_PARM_NEXT_VOL_SEQ2: |
919 |
p_obj->info_use_seq2 = arg ? true : false; |
922 |
p_obj->info_use_seq2 = arg ? true : false; |
920 |
vcd_debug ("changing 'next volume use sequence 2' to %d", |
923 |
vcd_debug ("changing 'next volume use sequence 2' to %d", |
921 |
p_obj->info_use_seq2); |
924 |
p_obj->info_use_seq2); |
922 |
break; |
925 |
break; |
923 |
|
926 |
|
Lines 925-931
Link Here
|
925 |
if (p_obj->type == VCD_TYPE_SVCD) |
928 |
if (p_obj->type == VCD_TYPE_SVCD) |
926 |
{ |
929 |
{ |
927 |
if ((p_obj->svcd_vcd3_mpegav = arg ? true : false)) |
930 |
if ((p_obj->svcd_vcd3_mpegav = arg ? true : false)) |
928 |
vcd_warn ("!! enabling deprecated VCD3.0 MPEGAV folder --" |
931 |
vcd_warn ("!! enabling deprecated VCD3.0 MPEGAV folder --" |
929 |
" SVCD will not be IEC62107 compliant !!"); |
932 |
" SVCD will not be IEC62107 compliant !!"); |
930 |
} |
933 |
} |
931 |
else |
934 |
else |
Lines 936-942
Link Here
|
936 |
if (p_obj->type == VCD_TYPE_SVCD) |
939 |
if (p_obj->type == VCD_TYPE_SVCD) |
937 |
{ |
940 |
{ |
938 |
if ((p_obj->svcd_vcd3_entrysvd = arg ? true : false)) |
941 |
if ((p_obj->svcd_vcd3_entrysvd = arg ? true : false)) |
939 |
vcd_warn ("!! enabling deprecated VCD3.0 ENTRYSVD signature --" |
942 |
vcd_warn ("!! enabling deprecated VCD3.0 ENTRYSVD signature --" |
940 |
" SVCD will not be IEC62107 compliant !!"); |
943 |
" SVCD will not be IEC62107 compliant !!"); |
941 |
} |
944 |
} |
942 |
else |
945 |
else |
Lines 947-953
Link Here
|
947 |
if (p_obj->type == VCD_TYPE_SVCD) |
950 |
if (p_obj->type == VCD_TYPE_SVCD) |
948 |
{ |
951 |
{ |
949 |
if ((p_obj->svcd_vcd3_tracksvd = arg ? true : false)) |
952 |
if ((p_obj->svcd_vcd3_tracksvd = arg ? true : false)) |
950 |
vcd_warn ("!! enabling deprecated VCD3.0 TRACK.SVD format --" |
953 |
vcd_warn ("!! enabling deprecated VCD3.0 TRACK.SVD format --" |
951 |
" SVCD will not be IEC62107 compliant !!"); |
954 |
" SVCD will not be IEC62107 compliant !!"); |
952 |
} |
955 |
} |
953 |
else |
956 |
else |
Lines 958-964
Link Here
|
958 |
if (_vcd_obj_has_cap_p (p_obj, _CAP_4C_SVCD)) |
961 |
if (_vcd_obj_has_cap_p (p_obj, _CAP_4C_SVCD)) |
959 |
{ |
962 |
{ |
960 |
p_obj->update_scan_offsets = arg ? true : false; |
963 |
p_obj->update_scan_offsets = arg ? true : false; |
961 |
vcd_debug ("changing 'update scan offsets' to %d", |
964 |
vcd_debug ("changing 'update scan offsets' to %d", |
962 |
p_obj->update_scan_offsets); |
965 |
p_obj->update_scan_offsets); |
963 |
} |
966 |
} |
964 |
else |
967 |
else |
Lines 968-974
Link Here
|
968 |
case VCD_PARM_LEADOUT_PAUSE: |
971 |
case VCD_PARM_LEADOUT_PAUSE: |
969 |
vcd_warn ("use of 'leadout pause' is deprecated and may be removed in later releases;" |
972 |
vcd_warn ("use of 'leadout pause' is deprecated and may be removed in later releases;" |
970 |
" use 'leadout pregap' instead"); |
973 |
" use 'leadout pregap' instead"); |
971 |
vcd_obj_set_param_uint (p_obj, VCD_PARM_LEADOUT_PREGAP, |
974 |
vcd_obj_set_param_uint (p_obj, VCD_PARM_LEADOUT_PREGAP, |
972 |
(arg ? CDIO_PREGAP_SECTORS : 0)); |
975 |
(arg ? CDIO_PREGAP_SECTORS : 0)); |
973 |
break; |
976 |
break; |
974 |
|
977 |
|
Lines 989-998
Link Here
|
989 |
vcd_assert (iso_pathname != NULL); |
992 |
vcd_assert (iso_pathname != NULL); |
990 |
|
993 |
|
991 |
_iso_pathname = _vcd_strdup_upper (iso_pathname); |
994 |
_iso_pathname = _vcd_strdup_upper (iso_pathname); |
992 |
|
995 |
|
993 |
if (!iso9660_dirname_valid_p (_iso_pathname)) |
996 |
if (!iso9660_dirname_valid_p (_iso_pathname)) |
994 |
{ |
997 |
{ |
995 |
vcd_error("pathname `%s' is not a valid iso pathname", |
998 |
vcd_error("pathname `%s' is not a valid iso pathname", |
996 |
_iso_pathname); |
999 |
_iso_pathname); |
997 |
free (_iso_pathname); |
1000 |
free (_iso_pathname); |
998 |
return 1; |
1001 |
return 1; |
Lines 1000-1006
Link Here
|
1000 |
|
1003 |
|
1001 |
_cdio_list_append (p_obj->custom_dir_list, _iso_pathname); |
1004 |
_cdio_list_append (p_obj->custom_dir_list, _iso_pathname); |
1002 |
|
1005 |
|
1003 |
_vcd_list_sort (p_obj->custom_dir_list, |
1006 |
_vcd_list_sort (p_obj->custom_dir_list, |
1004 |
(_cdio_list_cmp_func_t) strcmp); |
1007 |
(_cdio_list_cmp_func_t) strcmp); |
1005 |
|
1008 |
|
1006 |
return 0; |
1009 |
return 0; |
Lines 1011-1017
Link Here
|
1011 |
VcdDataSource_t *file, bool raw_flag) |
1014 |
VcdDataSource_t *file, bool raw_flag) |
1012 |
{ |
1015 |
{ |
1013 |
uint32_t size = 0, sectors = 0; |
1016 |
uint32_t size = 0, sectors = 0; |
1014 |
|
1017 |
|
1015 |
vcd_assert (p_obj != NULL); |
1018 |
vcd_assert (p_obj != NULL); |
1016 |
vcd_assert (file != NULL); |
1019 |
vcd_assert (file != NULL); |
1017 |
vcd_assert (iso_pathname != NULL); |
1020 |
vcd_assert (iso_pathname != NULL); |
Lines 1035-1041
Link Here
|
1035 |
|
1038 |
|
1036 |
if (size % M2RAW_SECTOR_SIZE) |
1039 |
if (size % M2RAW_SECTOR_SIZE) |
1037 |
{ |
1040 |
{ |
1038 |
vcd_error("raw mode2 file must have size multiple of %d \n", |
1041 |
vcd_error("raw mode2 file must have size multiple of %d \n", |
1039 |
M2RAW_SECTOR_SIZE); |
1042 |
M2RAW_SECTOR_SIZE); |
1040 |
return 1; |
1043 |
return 1; |
1041 |
} |
1044 |
} |
Lines 1046-1066
Link Here
|
1046 |
{ |
1049 |
{ |
1047 |
custom_file_t *p; |
1050 |
custom_file_t *p; |
1048 |
char *_iso_pathname = _vcd_strdup_upper (iso_pathname); |
1051 |
char *_iso_pathname = _vcd_strdup_upper (iso_pathname); |
1049 |
|
1052 |
|
1050 |
if (!iso9660_pathname_valid_p (_iso_pathname)) |
1053 |
if (!iso9660_pathname_valid_p (_iso_pathname)) |
1051 |
{ |
1054 |
{ |
1052 |
vcd_error("pathname `%s' is not a valid iso pathname", |
1055 |
vcd_error("pathname `%s' is not a valid iso pathname", |
1053 |
_iso_pathname); |
1056 |
_iso_pathname); |
1054 |
free (_iso_pathname); |
1057 |
free (_iso_pathname); |
1055 |
return 1; |
1058 |
return 1; |
1056 |
} |
1059 |
} |
1057 |
|
1060 |
|
1058 |
p = calloc(1, sizeof (custom_file_t)); |
1061 |
p = calloc(1, sizeof (custom_file_t)); |
1059 |
|
1062 |
|
1060 |
p->file = file; |
1063 |
p->file = file; |
1061 |
p->iso_pathname = _iso_pathname; |
1064 |
p->iso_pathname = _iso_pathname; |
1062 |
p->raw_flag = raw_flag; |
1065 |
p->raw_flag = raw_flag; |
1063 |
|
1066 |
|
1064 |
p->size = size; |
1067 |
p->size = size; |
1065 |
p->start_extent = 0; |
1068 |
p->start_extent = 0; |
1066 |
p->sectors = sectors; |
1069 |
p->sectors = sectors; |
Lines 1077-1084
Link Here
|
1077 |
int n; |
1080 |
int n; |
1078 |
CdioListNode_t *p_node; |
1081 |
CdioListNode_t *p_node; |
1079 |
|
1082 |
|
1080 |
uint32_t dir_secs = SECTOR_NIL; |
|
|
1081 |
|
1082 |
_dict_clean (p_obj); |
1083 |
_dict_clean (p_obj); |
1083 |
|
1084 |
|
1084 |
/* pre-alloc 16 blocks of ISO9660 required silence */ |
1085 |
/* pre-alloc 16 blocks of ISO9660 required silence */ |
Lines 1086-1092
Link Here
|
1086 |
vcd_assert_not_reached (); |
1087 |
vcd_assert_not_reached (); |
1087 |
|
1088 |
|
1088 |
/* keep karaoke sectors blank -- well... guess I'm too paranoid :) */ |
1089 |
/* keep karaoke sectors blank -- well... guess I'm too paranoid :) */ |
1089 |
if (_vcd_salloc (p_obj->iso_bitmap, 75, 75) == SECTOR_NIL) |
1090 |
if (_vcd_salloc (p_obj->iso_bitmap, 75, 75) == SECTOR_NIL) |
1090 |
vcd_assert_not_reached (); |
1091 |
vcd_assert_not_reached (); |
1091 |
|
1092 |
|
1092 |
/* pre-alloc descriptors, PVD */ |
1093 |
/* pre-alloc descriptors, PVD */ |
Lines 1095-1104
Link Here
|
1095 |
_dict_insert (p_obj, "evd", ISO_EVD_SECTOR, 1, SM_EOR|SM_EOF); /* EOR+EOF */ |
1096 |
_dict_insert (p_obj, "evd", ISO_EVD_SECTOR, 1, SM_EOR|SM_EOF); /* EOR+EOF */ |
1096 |
|
1097 |
|
1097 |
/* reserve for iso directory */ |
1098 |
/* reserve for iso directory */ |
1098 |
dir_secs = _vcd_salloc (p_obj->iso_bitmap, 18, 75-18); |
1099 |
_vcd_salloc (p_obj->iso_bitmap, 18, 75-18); |
1099 |
|
1100 |
|
1100 |
/* VCD information area */ |
1101 |
/* VCD information area */ |
1101 |
|
1102 |
|
1102 |
_dict_insert (p_obj, "info", INFO_VCD_SECTOR, 1, SM_EOF); /* INFO.VCD */ /* EOF */ |
1103 |
_dict_insert (p_obj, "info", INFO_VCD_SECTOR, 1, SM_EOF); /* INFO.VCD */ /* EOF */ |
1103 |
_dict_insert (p_obj, "entries", ENTRIES_VCD_SECTOR, 1, SM_EOF); /* ENTRIES.VCD */ /* EOF */ |
1104 |
_dict_insert (p_obj, "entries", ENTRIES_VCD_SECTOR, 1, SM_EOF); /* ENTRIES.VCD */ /* EOF */ |
1104 |
|
1105 |
|
Lines 1107-1120
Link Here
|
1107 |
if (_vcd_pbc_available (p_obj)) |
1108 |
if (_vcd_pbc_available (p_obj)) |
1108 |
{ |
1109 |
{ |
1109 |
_dict_insert (p_obj, "lot", LOT_VCD_SECTOR, LOT_VCD_SIZE, SM_EOF); /* LOT.VCD */ /* EOF */ |
1110 |
_dict_insert (p_obj, "lot", LOT_VCD_SECTOR, LOT_VCD_SIZE, SM_EOF); /* LOT.VCD */ /* EOF */ |
1110 |
_dict_insert (p_obj, "psd", PSD_VCD_SECTOR, |
1111 |
_dict_insert (p_obj, "psd", PSD_VCD_SECTOR, |
1111 |
_vcd_len2blocks (get_psd_size (p_obj, false), ISO_BLOCKSIZE), SM_EOF); /* PSD.VCD */ /* EOF */ |
1112 |
_vcd_len2blocks (get_psd_size (p_obj, false), ISO_BLOCKSIZE), SM_EOF); /* PSD.VCD */ /* EOF */ |
1112 |
} |
1113 |
} |
1113 |
|
1114 |
|
1114 |
if (_vcd_obj_has_cap_p (p_obj, _CAP_4C_SVCD)) |
1115 |
if (_vcd_obj_has_cap_p (p_obj, _CAP_4C_SVCD)) |
1115 |
{ |
1116 |
{ |
1116 |
_dict_insert (p_obj, "tracks", SECTOR_NIL, 1, SM_EOF); /* TRACKS.SVD */ |
1117 |
_dict_insert (p_obj, "tracks", SECTOR_NIL, 1, SM_EOF); /* TRACKS.SVD */ |
1117 |
_dict_insert (p_obj, "search", SECTOR_NIL, |
1118 |
_dict_insert (p_obj, "search", SECTOR_NIL, |
1118 |
_vcd_len2blocks (get_search_dat_size (p_obj), ISO_BLOCKSIZE), SM_EOF); /* SEARCH.DAT */ |
1119 |
_vcd_len2blocks (get_search_dat_size (p_obj), ISO_BLOCKSIZE), SM_EOF); /* SEARCH.DAT */ |
1119 |
|
1120 |
|
1120 |
vcd_assert (_dict_get_bykey (p_obj, "tracks")->sector > INFO_VCD_SECTOR); |
1121 |
vcd_assert (_dict_get_bykey (p_obj, "tracks")->sector > INFO_VCD_SECTOR); |
Lines 1123-1135
Link Here
|
1123 |
|
1124 |
|
1124 |
/* done with primary information area */ |
1125 |
/* done with primary information area */ |
1125 |
|
1126 |
|
1126 |
p_obj->mpeg_segment_start_extent = |
1127 |
p_obj->mpeg_segment_start_extent = |
1127 |
_vcd_len2blocks (_vcd_salloc_get_highest (p_obj->iso_bitmap) + 1, 75) * 75; |
1128 |
_vcd_len2blocks (_vcd_salloc_get_highest (p_obj->iso_bitmap) + 1, 75) * 75; |
1128 |
|
1129 |
|
1129 |
/* salloc up to end of vcd sector */ |
1130 |
/* salloc up to end of vcd sector */ |
1130 |
for(n = 0;n < p_obj->mpeg_segment_start_extent;n++) |
1131 |
for(n = 0;n < p_obj->mpeg_segment_start_extent;n++) |
1131 |
_vcd_salloc (p_obj->iso_bitmap, n, 1); |
1132 |
_vcd_salloc (p_obj->iso_bitmap, n, 1); |
1132 |
|
1133 |
|
1133 |
vcd_assert (_vcd_salloc_get_highest (p_obj->iso_bitmap) + 1 == p_obj->mpeg_segment_start_extent); |
1134 |
vcd_assert (_vcd_salloc_get_highest (p_obj->iso_bitmap) + 1 == p_obj->mpeg_segment_start_extent); |
1134 |
|
1135 |
|
1135 |
/* insert segments */ |
1136 |
/* insert segments */ |
Lines 1137-1150
Link Here
|
1137 |
_CDIO_LIST_FOREACH (p_node, p_obj->mpeg_segment_list) |
1138 |
_CDIO_LIST_FOREACH (p_node, p_obj->mpeg_segment_list) |
1138 |
{ |
1139 |
{ |
1139 |
mpeg_segment_t *_segment = _cdio_list_node_data (p_node); |
1140 |
mpeg_segment_t *_segment = _cdio_list_node_data (p_node); |
1140 |
|
1141 |
|
1141 |
_segment->start_extent = |
1142 |
_segment->start_extent = |
1142 |
_vcd_salloc (p_obj->iso_bitmap, SECTOR_NIL, |
1143 |
_vcd_salloc (p_obj->iso_bitmap, SECTOR_NIL, |
1143 |
_segment->segment_count * VCDINFO_SEGMENT_SECTOR_SIZE); |
1144 |
_segment->segment_count * VCDINFO_SEGMENT_SECTOR_SIZE); |
1144 |
|
1145 |
|
1145 |
vcd_assert (_segment->start_extent % 75 == 0); |
1146 |
vcd_assert (_segment->start_extent % 75 == 0); |
1146 |
vcd_assert (_vcd_salloc_get_highest (p_obj->iso_bitmap) + 1 |
1147 |
vcd_assert (_vcd_salloc_get_highest (p_obj->iso_bitmap) + 1 |
1147 |
== _segment->start_extent |
1148 |
== _segment->start_extent |
1148 |
+ _segment->segment_count * VCDINFO_SEGMENT_SECTOR_SIZE); |
1149 |
+ _segment->segment_count * VCDINFO_SEGMENT_SECTOR_SIZE); |
1149 |
} |
1150 |
} |
1150 |
|
1151 |
|
Lines 1156-1162
Link Here
|
1156 |
|
1157 |
|
1157 |
if (_vcd_obj_has_cap_p (p_obj, _CAP_4C_SVCD)) |
1158 |
if (_vcd_obj_has_cap_p (p_obj, _CAP_4C_SVCD)) |
1158 |
{ |
1159 |
{ |
1159 |
_dict_insert (p_obj, "scandata", SECTOR_NIL, |
1160 |
_dict_insert (p_obj, "scandata", SECTOR_NIL, |
1160 |
_vcd_len2blocks (get_scandata_dat_size (p_obj), |
1161 |
_vcd_len2blocks (get_scandata_dat_size (p_obj), |
1161 |
ISO_BLOCKSIZE), |
1162 |
ISO_BLOCKSIZE), |
1162 |
SM_EOF); |
1163 |
SM_EOF); |
Lines 1166-1174
Link Here
|
1166 |
&&_vcd_pbc_available (p_obj)) |
1167 |
&&_vcd_pbc_available (p_obj)) |
1167 |
{ |
1168 |
{ |
1168 |
_dict_insert (p_obj, "lot_x", SECTOR_NIL, LOT_VCD_SIZE, SM_EOF); |
1169 |
_dict_insert (p_obj, "lot_x", SECTOR_NIL, LOT_VCD_SIZE, SM_EOF); |
1169 |
|
1170 |
|
1170 |
_dict_insert (p_obj, "psd_x", SECTOR_NIL, |
1171 |
_dict_insert (p_obj, "psd_x", SECTOR_NIL, |
1171 |
_vcd_len2blocks (get_psd_size (p_obj, true), |
1172 |
_vcd_len2blocks (get_psd_size (p_obj, true), |
1172 |
ISO_BLOCKSIZE), SM_EOF); |
1173 |
ISO_BLOCKSIZE), SM_EOF); |
1173 |
} |
1174 |
} |
1174 |
|
1175 |
|
Lines 1181-1187
Link Here
|
1181 |
_CDIO_LIST_FOREACH (p_node, p_obj->custom_file_list) |
1182 |
_CDIO_LIST_FOREACH (p_node, p_obj->custom_file_list) |
1182 |
{ |
1183 |
{ |
1183 |
custom_file_t *p = _cdio_list_node_data (p_node); |
1184 |
custom_file_t *p = _cdio_list_node_data (p_node); |
1184 |
|
1185 |
|
1185 |
if (p->sectors) |
1186 |
if (p->sectors) |
1186 |
{ |
1187 |
{ |
1187 |
p->start_extent = |
1188 |
p->start_extent = |
Lines 1198-1205
Link Here
|
1198 |
p_obj->iso_size = |
1199 |
p_obj->iso_size = |
1199 |
MAX (MIN_ISO_SIZE, _vcd_salloc_get_highest (p_obj->iso_bitmap) + 1); |
1200 |
MAX (MIN_ISO_SIZE, _vcd_salloc_get_highest (p_obj->iso_bitmap) + 1); |
1200 |
|
1201 |
|
1201 |
vcd_debug ("iso9660: highest alloced sector is %lu (using %d as isosize)", |
1202 |
vcd_debug ("iso9660: highest alloced sector is %lu (using %d as isosize)", |
1202 |
(unsigned long int) _vcd_salloc_get_highest (p_obj->iso_bitmap), |
1203 |
(unsigned long int) _vcd_salloc_get_highest (p_obj->iso_bitmap), |
1203 |
p_obj->iso_size); |
1204 |
p_obj->iso_size); |
1204 |
|
1205 |
|
1205 |
/* after this point the ISO9660's size is frozen */ |
1206 |
/* after this point the ISO9660's size is frozen */ |
Lines 1229-1249
Link Here
|
1229 |
if (_cdio_list_length (p_obj->mpeg_segment_list)) |
1230 |
if (_cdio_list_length (p_obj->mpeg_segment_list)) |
1230 |
_vcd_directory_mkdir (p_obj->dir, "SEGMENT"); |
1231 |
_vcd_directory_mkdir (p_obj->dir, "SEGMENT"); |
1231 |
|
1232 |
|
1232 |
_vcd_directory_mkfile (p_obj->dir, "VCD/ENTRIES.VCD", |
1233 |
_vcd_directory_mkfile (p_obj->dir, "VCD/ENTRIES.VCD", |
1233 |
_dict_get_bykey (p_obj, "entries")->sector, |
1234 |
_dict_get_bykey (p_obj, "entries")->sector, |
1234 |
ISO_BLOCKSIZE, false, 0); |
1235 |
ISO_BLOCKSIZE, false, 0); |
1235 |
_vcd_directory_mkfile (p_obj->dir, "VCD/INFO.VCD", |
1236 |
_vcd_directory_mkfile (p_obj->dir, "VCD/INFO.VCD", |
1236 |
_dict_get_bykey (p_obj, "info")->sector, |
1237 |
_dict_get_bykey (p_obj, "info")->sector, |
1237 |
ISO_BLOCKSIZE, false, 0); |
1238 |
ISO_BLOCKSIZE, false, 0); |
1238 |
|
1239 |
|
1239 |
/* only for vcd2.0 */ |
1240 |
/* only for vcd2.0 */ |
1240 |
if (_vcd_pbc_available (p_obj)) |
1241 |
if (_vcd_pbc_available (p_obj)) |
1241 |
{ |
1242 |
{ |
1242 |
_vcd_directory_mkfile (p_obj->dir, "VCD/LOT.VCD", |
1243 |
_vcd_directory_mkfile (p_obj->dir, "VCD/LOT.VCD", |
1243 |
_dict_get_bykey (p_obj, "lot")->sector, |
1244 |
_dict_get_bykey (p_obj, "lot")->sector, |
1244 |
ISO_BLOCKSIZE*LOT_VCD_SIZE, false, 0); |
1245 |
ISO_BLOCKSIZE*LOT_VCD_SIZE, false, 0); |
1245 |
_vcd_directory_mkfile (p_obj->dir, "VCD/PSD.VCD", |
1246 |
_vcd_directory_mkfile (p_obj->dir, "VCD/PSD.VCD", |
1246 |
_dict_get_bykey (p_obj, "psd")->sector, |
1247 |
_dict_get_bykey (p_obj, "psd")->sector, |
1247 |
get_psd_size (p_obj, false), false, 0); |
1248 |
get_psd_size (p_obj, false), false, 0); |
1248 |
} |
1249 |
} |
1249 |
break; |
1250 |
break; |
Lines 1267-1293
Link Here
|
1267 |
_vcd_directory_mkdir (p_obj->dir, "SVCD"); |
1268 |
_vcd_directory_mkdir (p_obj->dir, "SVCD"); |
1268 |
|
1269 |
|
1269 |
_vcd_directory_mkfile (p_obj->dir, "SVCD/ENTRIES.SVD", |
1270 |
_vcd_directory_mkfile (p_obj->dir, "SVCD/ENTRIES.SVD", |
1270 |
_dict_get_bykey (p_obj, "entries")->sector, |
1271 |
_dict_get_bykey (p_obj, "entries")->sector, |
1271 |
ISO_BLOCKSIZE, false, 0); |
1272 |
ISO_BLOCKSIZE, false, 0); |
1272 |
_vcd_directory_mkfile (p_obj->dir, "SVCD/INFO.SVD", |
1273 |
_vcd_directory_mkfile (p_obj->dir, "SVCD/INFO.SVD", |
1273 |
_dict_get_bykey (p_obj, "info")->sector, |
1274 |
_dict_get_bykey (p_obj, "info")->sector, |
1274 |
ISO_BLOCKSIZE, false, 0); |
1275 |
ISO_BLOCKSIZE, false, 0); |
1275 |
|
1276 |
|
1276 |
if (_vcd_pbc_available (p_obj)) |
1277 |
if (_vcd_pbc_available (p_obj)) |
1277 |
{ |
1278 |
{ |
1278 |
_vcd_directory_mkfile (p_obj->dir, "SVCD/LOT.SVD", |
1279 |
_vcd_directory_mkfile (p_obj->dir, "SVCD/LOT.SVD", |
1279 |
_dict_get_bykey (p_obj, "lot")->sector, |
1280 |
_dict_get_bykey (p_obj, "lot")->sector, |
1280 |
ISO_BLOCKSIZE*LOT_VCD_SIZE, false, 0); |
1281 |
ISO_BLOCKSIZE*LOT_VCD_SIZE, false, 0); |
1281 |
_vcd_directory_mkfile (p_obj->dir, "SVCD/PSD.SVD", |
1282 |
_vcd_directory_mkfile (p_obj->dir, "SVCD/PSD.SVD", |
1282 |
_dict_get_bykey (p_obj, "psd")->sector, |
1283 |
_dict_get_bykey (p_obj, "psd")->sector, |
1283 |
get_psd_size (p_obj, false), false, 0); |
1284 |
get_psd_size (p_obj, false), false, 0); |
1284 |
} |
1285 |
} |
1285 |
|
1286 |
|
1286 |
_vcd_directory_mkfile (p_obj->dir, "SVCD/SEARCH.DAT", |
1287 |
_vcd_directory_mkfile (p_obj->dir, "SVCD/SEARCH.DAT", |
1287 |
_dict_get_bykey (p_obj, "search")->sector, |
1288 |
_dict_get_bykey (p_obj, "search")->sector, |
1288 |
get_search_dat_size (p_obj), false, 0); |
1289 |
get_search_dat_size (p_obj), false, 0); |
1289 |
_vcd_directory_mkfile (p_obj->dir, "SVCD/TRACKS.SVD", |
1290 |
_vcd_directory_mkfile (p_obj->dir, "SVCD/TRACKS.SVD", |
1290 |
_dict_get_bykey (p_obj, "tracks")->sector, |
1291 |
_dict_get_bykey (p_obj, "tracks")->sector, |
1291 |
ISO_BLOCKSIZE, false, 0); |
1292 |
ISO_BLOCKSIZE, false, 0); |
1292 |
break; |
1293 |
break; |
1293 |
|
1294 |
|
Lines 1306-1312
Link Here
|
1306 |
const char *fmt = NULL; |
1307 |
const char *fmt = NULL; |
1307 |
uint8_t fnum = 0; |
1308 |
uint8_t fnum = 0; |
1308 |
|
1309 |
|
1309 |
switch (p_obj->type) |
1310 |
switch (p_obj->type) |
1310 |
{ |
1311 |
{ |
1311 |
case VCD_TYPE_VCD2: |
1312 |
case VCD_TYPE_VCD2: |
1312 |
fmt = "SEGMENT/ITEM%4.4d.DAT"; |
1313 |
fmt = "SEGMENT/ITEM%4.4d.DAT"; |
Lines 1320-1329
Link Here
|
1320 |
default: |
1321 |
default: |
1321 |
vcd_assert_not_reached (); |
1322 |
vcd_assert_not_reached (); |
1322 |
} |
1323 |
} |
1323 |
|
1324 |
|
1324 |
snprintf (segment_pathname, sizeof (segment_pathname), fmt, n); |
1325 |
snprintf (segment_pathname, sizeof (segment_pathname), fmt, n); |
1325 |
|
1326 |
|
1326 |
_vcd_directory_mkfile (p_obj->dir, segment_pathname, |
1327 |
_vcd_directory_mkfile (p_obj->dir, segment_pathname, |
1327 |
segment->start_extent, |
1328 |
segment->start_extent, |
1328 |
segment->info->packets * ISO_BLOCKSIZE, |
1329 |
segment->info->packets * ISO_BLOCKSIZE, |
1329 |
true, fnum); |
1330 |
true, fnum); |
Lines 1340-1351
Link Here
|
1340 |
{ |
1341 |
{ |
1341 |
/* psd_x -- extended PSD */ |
1342 |
/* psd_x -- extended PSD */ |
1342 |
_vcd_directory_mkfile (p_obj->dir, "EXT/PSD_X.VCD", |
1343 |
_vcd_directory_mkfile (p_obj->dir, "EXT/PSD_X.VCD", |
1343 |
_dict_get_bykey (p_obj, "psd_x")->sector, |
1344 |
_dict_get_bykey (p_obj, "psd_x")->sector, |
1344 |
get_psd_size (p_obj, true), false, 1); |
1345 |
get_psd_size (p_obj, true), false, 1); |
1345 |
|
1346 |
|
1346 |
/* lot_x -- extended LOT */ |
1347 |
/* lot_x -- extended LOT */ |
1347 |
_vcd_directory_mkfile (p_obj->dir, "EXT/LOT_X.VCD", |
1348 |
_vcd_directory_mkfile (p_obj->dir, "EXT/LOT_X.VCD", |
1348 |
_dict_get_bykey (p_obj, "lot_x")->sector, |
1349 |
_dict_get_bykey (p_obj, "lot_x")->sector, |
1349 |
ISO_BLOCKSIZE*LOT_VCD_SIZE, false, 1); |
1350 |
ISO_BLOCKSIZE*LOT_VCD_SIZE, false, 1); |
1350 |
|
1351 |
|
1351 |
vcd_assert (p_obj->type == VCD_TYPE_VCD2); |
1352 |
vcd_assert (p_obj->type == VCD_TYPE_VCD2); |
Lines 1355-1361
Link Here
|
1355 |
{ |
1356 |
{ |
1356 |
/* scandata.dat -- scanpoints */ |
1357 |
/* scandata.dat -- scanpoints */ |
1357 |
_vcd_directory_mkfile (p_obj->dir, "EXT/SCANDATA.DAT", |
1358 |
_vcd_directory_mkfile (p_obj->dir, "EXT/SCANDATA.DAT", |
1358 |
_dict_get_bykey (p_obj, "scandata")->sector, |
1359 |
_dict_get_bykey (p_obj, "scandata")->sector, |
1359 |
get_scandata_dat_size (p_obj), false, 0); |
1360 |
get_scandata_dat_size (p_obj), false, 0); |
1360 |
} |
1361 |
} |
1361 |
|
1362 |
|
Lines 1371-1379
Link Here
|
1371 |
custom_file_t *p = _cdio_list_node_data (p_node); |
1372 |
custom_file_t *p = _cdio_list_node_data (p_node); |
1372 |
|
1373 |
|
1373 |
_vcd_directory_mkfile (p_obj->dir, p->iso_pathname, p->start_extent, |
1374 |
_vcd_directory_mkfile (p_obj->dir, p->iso_pathname, p->start_extent, |
1374 |
(p->raw_flag |
1375 |
(p->raw_flag |
1375 |
? (ISO_BLOCKSIZE * (p->size / M2RAW_SECTOR_SIZE)) |
1376 |
? (ISO_BLOCKSIZE * (p->size / M2RAW_SECTOR_SIZE)) |
1376 |
: p->size), |
1377 |
: p->size), |
1377 |
p->raw_flag, 1); |
1378 |
p->raw_flag, 1); |
1378 |
} |
1379 |
} |
1379 |
|
1380 |
|
Lines 1386-1395
Link Here
|
1386 |
mpeg_sequence_t *p_sequence = _cdio_list_node_data (p_node); |
1387 |
mpeg_sequence_t *p_sequence = _cdio_list_node_data (p_node); |
1387 |
uint32_t extent = p_sequence->relative_start_extent; |
1388 |
uint32_t extent = p_sequence->relative_start_extent; |
1388 |
uint8_t file_num = 0; |
1389 |
uint8_t file_num = 0; |
1389 |
|
1390 |
|
1390 |
extent += p_obj->iso_size; |
1391 |
extent += p_obj->iso_size; |
1391 |
|
1392 |
|
1392 |
switch (p_obj->type) |
1393 |
switch (p_obj->type) |
1393 |
{ |
1394 |
{ |
1394 |
case VCD_TYPE_VCD: |
1395 |
case VCD_TYPE_VCD: |
1395 |
fmt = "MPEGAV/MUSIC%2.2d.DAT"; |
1396 |
fmt = "MPEGAV/MUSIC%2.2d.DAT"; |
Lines 1412-1430
Link Here
|
1412 |
fmt = "MPEGAV/AVSEQ%2.2d.MPG"; |
1413 |
fmt = "MPEGAV/AVSEQ%2.2d.MPG"; |
1413 |
file_num = n + 1; |
1414 |
file_num = n + 1; |
1414 |
} |
1415 |
} |
1415 |
|
1416 |
|
1416 |
break; |
1417 |
break; |
1417 |
default: |
1418 |
default: |
1418 |
vcd_assert_not_reached (); |
1419 |
vcd_assert_not_reached (); |
1419 |
} |
1420 |
} |
1420 |
|
1421 |
|
1421 |
vcd_assert (n < 98); |
1422 |
vcd_assert (n < 98); |
1422 |
|
1423 |
|
1423 |
snprintf (avseq_pathname, sizeof (avseq_pathname), fmt, n + 1); |
1424 |
snprintf (avseq_pathname, sizeof (avseq_pathname), fmt, n + 1); |
1424 |
|
1425 |
|
1425 |
/* file entry contains front margin, mpeg stream and rear margin */ |
1426 |
/* file entry contains front margin, mpeg stream and rear margin */ |
1426 |
_vcd_directory_mkfile (p_obj->dir, avseq_pathname, extent, |
1427 |
_vcd_directory_mkfile (p_obj->dir, avseq_pathname, extent, |
1427 |
(p_obj->track_front_margin |
1428 |
(p_obj->track_front_margin |
1428 |
+ p_sequence->info->packets |
1429 |
+ p_sequence->info->packets |
1429 |
+ p_obj->track_rear_margin) * ISO_BLOCKSIZE, |
1430 |
+ p_obj->track_rear_margin) * ISO_BLOCKSIZE, |
1430 |
true, file_num); |
1431 |
true, file_num); |
Lines 1435-1467
Link Here
|
1435 |
/* register isofs dir structures */ |
1436 |
/* register isofs dir structures */ |
1436 |
{ |
1437 |
{ |
1437 |
uint32_t dirs_size = _vcd_directory_get_size (p_obj->dir); |
1438 |
uint32_t dirs_size = _vcd_directory_get_size (p_obj->dir); |
1438 |
|
1439 |
|
1439 |
/* be sure to stay out of information areas */ |
1440 |
/* be sure to stay out of information areas */ |
1440 |
|
1441 |
|
1441 |
switch (p_obj->type) |
1442 |
switch (p_obj->type) |
1442 |
{ |
1443 |
{ |
1443 |
case VCD_TYPE_VCD: |
1444 |
case VCD_TYPE_VCD: |
1444 |
case VCD_TYPE_VCD11: |
1445 |
case VCD_TYPE_VCD11: |
1445 |
case VCD_TYPE_VCD2: |
1446 |
case VCD_TYPE_VCD2: |
1446 |
/* karaoke area starts at 03:00 */ |
1447 |
/* karaoke area starts at 03:00 */ |
1447 |
if (16 + 2 + dirs_size + 2 >= 75) |
1448 |
if (16 + 2 + dirs_size + 2 >= 75) |
1448 |
vcd_error ("directory section to big for a VCD"); |
1449 |
vcd_error ("directory section to big for a VCD"); |
1449 |
break; |
1450 |
break; |
1450 |
|
1451 |
|
1451 |
case VCD_TYPE_SVCD: |
1452 |
case VCD_TYPE_SVCD: |
1452 |
case VCD_TYPE_HQVCD: |
1453 |
case VCD_TYPE_HQVCD: |
1453 |
/* since no karaoke exists the next fixed area starts at 04:00 */ |
1454 |
/* since no karaoke exists the next fixed area starts at 04:00 */ |
1454 |
if (16 + 2 + dirs_size + 2 >= 150) |
1455 |
if (16 + 2 + dirs_size + 2 >= 150) |
1455 |
vcd_error ("directory section to big for a SVCD"); |
1456 |
vcd_error ("directory section to big for a SVCD"); |
1456 |
break; |
1457 |
break; |
1457 |
default: |
1458 |
default: |
1458 |
vcd_assert_not_reached (); |
1459 |
vcd_assert_not_reached (); |
1459 |
} |
1460 |
} |
1460 |
|
1461 |
|
1461 |
/* un-alloc small area */ |
1462 |
/* un-alloc small area */ |
1462 |
|
1463 |
|
1463 |
_vcd_salloc_free (p_obj->iso_bitmap, 18, dirs_size + 2); |
1464 |
_vcd_salloc_free (p_obj->iso_bitmap, 18, dirs_size + 2); |
1464 |
|
1465 |
|
1465 |
/* alloc it again! */ |
1466 |
/* alloc it again! */ |
1466 |
|
1467 |
|
1467 |
_dict_insert (p_obj, "dir", 18, dirs_size, SM_EOR|SM_EOF); |
1468 |
_dict_insert (p_obj, "dir", 18, dirs_size, SM_EOR|SM_EOF); |
Lines 1492-1498
Link Here
|
1492 |
progress_info_t _pi; |
1493 |
progress_info_t _pi; |
1493 |
|
1494 |
|
1494 |
_pi.sectors_written = p_obj->sectors_written; |
1495 |
_pi.sectors_written = p_obj->sectors_written; |
1495 |
_pi.total_sectors = p_obj->relative_end_extent + p_obj->iso_size; |
1496 |
_pi.total_sectors = p_obj->relative_end_extent + p_obj->iso_size; |
1496 |
_pi.in_track = p_obj->in_track; |
1497 |
_pi.in_track = p_obj->in_track; |
1497 |
_pi.total_tracks = _cdio_list_length (p_obj->mpeg_sequence_list) + 1; |
1498 |
_pi.total_tracks = _cdio_list_length (p_obj->mpeg_sequence_list) + 1; |
1498 |
|
1499 |
|
Lines 1504-1510
Link Here
|
1504 |
|
1505 |
|
1505 |
static int |
1506 |
static int |
1506 |
_write_m2_image_sector (VcdObj_t *obj, const void *data, uint32_t extent, |
1507 |
_write_m2_image_sector (VcdObj_t *obj, const void *data, uint32_t extent, |
1507 |
uint8_t fnum, uint8_t cnum, uint8_t sm, uint8_t ci) |
1508 |
uint8_t fnum, uint8_t cnum, uint8_t sm, uint8_t ci) |
1508 |
{ |
1509 |
{ |
1509 |
char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, }; |
1510 |
char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, }; |
1510 |
|
1511 |
|
Lines 1513-1519
Link Here
|
1513 |
_vcd_make_mode2(buf, data, extent, fnum, cnum, sm, ci); |
1514 |
_vcd_make_mode2(buf, data, extent, fnum, cnum, sm, ci); |
1514 |
|
1515 |
|
1515 |
vcd_image_sink_write (obj->image_sink, buf, extent); |
1516 |
vcd_image_sink_write (obj->image_sink, buf, extent); |
1516 |
|
1517 |
|
1517 |
obj->sectors_written++; |
1518 |
obj->sectors_written++; |
1518 |
|
1519 |
|
1519 |
return _callback_wrapper (obj, false); |
1520 |
return _callback_wrapper (obj, false); |
Lines 1536-1542
Link Here
|
1536 |
} |
1537 |
} |
1537 |
|
1538 |
|
1538 |
static void |
1539 |
static void |
1539 |
_write_source_mode2_raw (VcdObj_t *obj, VcdDataSource_t *source, |
1540 |
_write_source_mode2_raw (VcdObj_t *obj, VcdDataSource_t *source, |
1540 |
uint32_t extent) |
1541 |
uint32_t extent) |
1541 |
{ |
1542 |
{ |
1542 |
int n; |
1543 |
int n; |
Lines 1544-1550
Link Here
|
1544 |
|
1545 |
|
1545 |
sectors = vcd_data_source_stat (source) / M2RAW_SECTOR_SIZE; |
1546 |
sectors = vcd_data_source_stat (source) / M2RAW_SECTOR_SIZE; |
1546 |
|
1547 |
|
1547 |
vcd_data_source_seek (source, 0); |
1548 |
vcd_data_source_seek (source, 0); |
1548 |
|
1549 |
|
1549 |
for (n = 0;n < sectors;n++) { |
1550 |
for (n = 0;n < sectors;n++) { |
1550 |
char buf[M2RAW_SECTOR_SIZE] = { 0, }; |
1551 |
char buf[M2RAW_SECTOR_SIZE] = { 0, }; |
Lines 1559-1565
Link Here
|
1559 |
} |
1560 |
} |
1560 |
|
1561 |
|
1561 |
static void |
1562 |
static void |
1562 |
_write_source_mode2_form1 (VcdObj_t *obj, VcdDataSource_t *source, |
1563 |
_write_source_mode2_form1 (VcdObj_t *obj, VcdDataSource_t *source, |
1563 |
uint32_t extent) |
1564 |
uint32_t extent) |
1564 |
{ |
1565 |
{ |
1565 |
int n; |
1566 |
int n; |
Lines 1573-1591
Link Here
|
1573 |
if (!last_block_size) |
1574 |
if (!last_block_size) |
1574 |
last_block_size = CDIO_CD_FRAMESIZE; |
1575 |
last_block_size = CDIO_CD_FRAMESIZE; |
1575 |
|
1576 |
|
1576 |
vcd_data_source_seek (source, 0); |
1577 |
vcd_data_source_seek (source, 0); |
1577 |
|
1578 |
|
1578 |
for (n = 0;n < sectors;n++) { |
1579 |
for (n = 0;n < sectors;n++) { |
1579 |
char buf[CDIO_CD_FRAMESIZE] = { 0, }; |
1580 |
char buf[CDIO_CD_FRAMESIZE] = { 0, }; |
1580 |
|
1581 |
|
1581 |
vcd_data_source_read (source, buf, |
1582 |
vcd_data_source_read (source, buf, |
1582 |
((n + 1 == sectors) |
1583 |
((n + 1 == sectors) |
1583 |
? last_block_size |
1584 |
? last_block_size |
1584 |
: CDIO_CD_FRAMESIZE), 1); |
1585 |
: CDIO_CD_FRAMESIZE), 1); |
1585 |
|
1586 |
|
1586 |
if (_write_m2_image_sector (obj, buf, extent+n, 1, 0, |
1587 |
if (_write_m2_image_sector (obj, buf, extent+n, 1, 0, |
1587 |
((n+1 < sectors) |
1588 |
((n+1 < sectors) |
1588 |
? SM_DATA |
1589 |
? SM_DATA |
1589 |
: SM_DATA |SM_EOF), |
1590 |
: SM_DATA |SM_EOF), |
1590 |
0)) |
1591 |
0)) |
1591 |
break; |
1592 |
break; |
Lines 1597-1603
Link Here
|
1597 |
static int |
1598 |
static int |
1598 |
_write_sequence (VcdObj_t *p_obj, int track_idx) |
1599 |
_write_sequence (VcdObj_t *p_obj, int track_idx) |
1599 |
{ |
1600 |
{ |
1600 |
mpeg_sequence_t *track = |
1601 |
mpeg_sequence_t *track = |
1601 |
_cdio_list_node_data (_vcd_list_at (p_obj->mpeg_sequence_list, track_idx)); |
1602 |
_cdio_list_node_data (_vcd_list_at (p_obj->mpeg_sequence_list, track_idx)); |
1602 |
CdioListNode_t *pause_node; |
1603 |
CdioListNode_t *pause_node; |
1603 |
int n, lastsect = p_obj->sectors_written; |
1604 |
int n, lastsect = p_obj->sectors_written; |
Lines 1631-1637
Link Here
|
1631 |
case MPEG_NORM_NTSC_S: |
1632 |
case MPEG_NORM_NTSC_S: |
1632 |
norm_str = strdup ("NTSC 2/3 D1 (480x480/29.97fps)"); |
1633 |
norm_str = strdup ("NTSC 2/3 D1 (480x480/29.97fps)"); |
1633 |
break; |
1634 |
break; |
1634 |
|
1635 |
|
1635 |
case MPEG_NORM_OTHER: |
1636 |
case MPEG_NORM_OTHER: |
1636 |
{ |
1637 |
{ |
1637 |
char buf[1024] = { 0, }; |
1638 |
char buf[1024] = { 0, }; |
Lines 1674-1690
Link Here
|
1674 |
0 |
1675 |
0 |
1675 |
}; |
1676 |
}; |
1676 |
|
1677 |
|
1677 |
int i_buf = snprintf (buf, sizeof (buf), |
1678 |
int i_buf = snprintf (buf, sizeof (buf), |
1678 |
"audio[%d]: l%d/%2.1fkHz/%dkbps/%s ", |
1679 |
"audio[%d]: l%d/%2.1fkHz/%dkbps/%s ", |
1679 |
i, |
1680 |
i, |
1680 |
track->info->ahdr[i].layer, |
1681 |
track->info->ahdr[i].layer, |
1681 |
track->info->ahdr[i].sampfreq / 1000.0, |
1682 |
track->info->ahdr[i].sampfreq / 1000.0, |
1682 |
track->info->ahdr[i].bitrate / 1024, |
1683 |
track->info->ahdr[i].bitrate / 1024, |
1683 |
_mode_str[track->info->ahdr[i].mode]); |
1684 |
_mode_str[track->info->ahdr[i].mode]); |
1684 |
|
1685 |
|
1685 |
strncat (buf2, buf, sizeof(buf2)-strlen(buf2)-i_buf2-1); |
1686 |
strncat (buf2, buf, sizeof(buf2)-strlen(buf2)-i_buf2-1); |
1686 |
i_buf2 += i_buf; |
1687 |
i_buf2 += i_buf; |
1687 |
} |
1688 |
} |
1688 |
|
1689 |
|
1689 |
vcd_info ("writing track %d, %s, %s, %s...", track_idx + 2, |
1690 |
vcd_info ("writing track %d, %s, %s, %s...", track_idx + 2, |
1690 |
(track->info->version == MPEG_VERS_MPEG1 ? "MPEG1" : "MPEG2"), |
1691 |
(track->info->version == MPEG_VERS_MPEG1 ? "MPEG1" : "MPEG2"), |
Lines 1708-1714
Link Here
|
1708 |
struct vcd_mpeg_packet_info pkt_flags; |
1709 |
struct vcd_mpeg_packet_info pkt_flags; |
1709 |
bool set_trigger = false; |
1710 |
bool set_trigger = false; |
1710 |
|
1711 |
|
1711 |
vcd_mpeg_source_get_packet (track->source, n, buf, &pkt_flags, |
1712 |
vcd_mpeg_source_get_packet (track->source, n, buf, &pkt_flags, |
1712 |
p_obj->update_scan_offsets); |
1713 |
p_obj->update_scan_offsets); |
1713 |
|
1714 |
|
1714 |
while (pause_node) |
1715 |
while (pause_node) |
Lines 1724-1736
Link Here
|
1724 |
/* seems it's time to trigger! */ |
1725 |
/* seems it's time to trigger! */ |
1725 |
set_trigger = true; |
1726 |
set_trigger = true; |
1726 |
|
1727 |
|
1727 |
vcd_debug ("setting auto pause trigger for time %f (pts %f) @%d", |
1728 |
vcd_debug ("setting auto pause trigger for time %f (pts %f) @%d", |
1728 |
_pause->time, pkt_flags.pts, n); |
1729 |
_pause->time, pkt_flags.pts, n); |
1729 |
|
1730 |
|
1730 |
pause_node = _cdio_list_node_next (pause_node); |
1731 |
pause_node = _cdio_list_node_next (pause_node); |
1731 |
} |
1732 |
} |
1732 |
|
1733 |
|
1733 |
switch (vcd_mpeg_packet_get_type (&pkt_flags)) |
1734 |
switch (vcd_mpeg_packet_get_type (&pkt_flags)) |
1734 |
{ |
1735 |
{ |
1735 |
case PKT_TYPE_VIDEO: |
1736 |
case PKT_TYPE_VIDEO: |
1736 |
mpeg_packets.video++; |
1737 |
mpeg_packets.video++; |
Lines 1745-1751
Link Here
|
1745 |
ci = CI_OGT; |
1746 |
ci = CI_OGT; |
1746 |
cnum = CN_OGT; |
1747 |
cnum = CN_OGT; |
1747 |
break; |
1748 |
break; |
1748 |
|
1749 |
|
1749 |
case PKT_TYPE_AUDIO: |
1750 |
case PKT_TYPE_AUDIO: |
1750 |
mpeg_packets.audio++; |
1751 |
mpeg_packets.audio++; |
1751 |
sm = SM_FORM2|SM_REALT|SM_AUDIO; |
1752 |
sm = SM_FORM2|SM_REALT|SM_AUDIO; |
Lines 1791-1799
Link Here
|
1791 |
sm |= SM_TRIG; |
1792 |
sm |= SM_TRIG; |
1792 |
|
1793 |
|
1793 |
fnum = track_idx + 1; |
1794 |
fnum = track_idx + 1; |
1794 |
|
1795 |
|
1795 |
if (_vcd_obj_has_cap_p (p_obj, _CAP_4C_SVCD) |
1796 |
if (_vcd_obj_has_cap_p (p_obj, _CAP_4C_SVCD) |
1796 |
&& !p_obj->svcd_vcd3_mpegav) /* IEC62107 SVCDs have a |
1797 |
&& !p_obj->svcd_vcd3_mpegav) /* IEC62107 SVCDs have a |
1797 |
simplified subheader */ |
1798 |
simplified subheader */ |
1798 |
{ |
1799 |
{ |
1799 |
fnum = 1; |
1800 |
fnum = 1; |
Lines 1850-1863
Link Here
|
1850 |
bool _need_eor = false; |
1851 |
bool _need_eor = false; |
1851 |
|
1852 |
|
1852 |
vcd_mpeg_source_get_packet (p_segment->source, packet_no, |
1853 |
vcd_mpeg_source_get_packet (p_segment->source, packet_no, |
1853 |
buf, &pkt_flags, |
1854 |
buf, &pkt_flags, |
1854 |
p_obj->update_scan_offsets); |
1855 |
p_obj->update_scan_offsets); |
1855 |
|
1856 |
|
1856 |
fn = 1; |
1857 |
fn = 1; |
1857 |
cn = CN_EMPTY; |
1858 |
cn = CN_EMPTY; |
1858 |
sm = SM_FORM2 | SM_REALT; |
1859 |
sm = SM_FORM2 | SM_REALT; |
1859 |
ci = CI_EMPTY; |
1860 |
ci = CI_EMPTY; |
1860 |
|
1861 |
|
1861 |
while (pause_node) |
1862 |
while (pause_node) |
1862 |
{ |
1863 |
{ |
1863 |
pause_t *_pause = _cdio_list_node_data (pause_node); |
1864 |
pause_t *_pause = _cdio_list_node_data (pause_node); |
Lines 1871-1883
Link Here
|
1871 |
/* seems it's time to trigger! */ |
1872 |
/* seems it's time to trigger! */ |
1872 |
set_trigger = true; |
1873 |
set_trigger = true; |
1873 |
|
1874 |
|
1874 |
vcd_debug ("setting auto pause trigger for time %f (pts %f) @%d", |
1875 |
vcd_debug ("setting auto pause trigger for time %f (pts %f) @%d", |
1875 |
_pause->time, pkt_flags.pts, n); |
1876 |
_pause->time, pkt_flags.pts, n); |
1876 |
|
1877 |
|
1877 |
pause_node = _cdio_list_node_next (pause_node); |
1878 |
pause_node = _cdio_list_node_next (pause_node); |
1878 |
} |
1879 |
} |
1879 |
|
1880 |
|
1880 |
switch (vcd_mpeg_packet_get_type (&pkt_flags)) |
1881 |
switch (vcd_mpeg_packet_get_type (&pkt_flags)) |
1881 |
{ |
1882 |
{ |
1882 |
case PKT_TYPE_VIDEO: |
1883 |
case PKT_TYPE_VIDEO: |
1883 |
sm = SM_FORM2 | SM_REALT | SM_VIDEO; |
1884 |
sm = SM_FORM2 | SM_REALT | SM_VIDEO; |
Lines 1893-1899
Link Here
|
1893 |
if (pkt_flags.video[1] || pkt_flags.video[2]) |
1894 |
if (pkt_flags.video[1] || pkt_flags.video[2]) |
1894 |
{ /* search for endcode -- hack */ |
1895 |
{ /* search for endcode -- hack */ |
1895 |
int idx; |
1896 |
int idx; |
1896 |
|
1897 |
|
1897 |
for (idx = 0; idx <= 2320; idx++) |
1898 |
for (idx = 0; idx <= 2320; idx++) |
1898 |
if (buf[idx] == 0x00 |
1899 |
if (buf[idx] == 0x00 |
1899 |
&& buf[idx + 1] == 0x00 |
1900 |
&& buf[idx + 1] == 0x00 |
Lines 1908-1914
Link Here
|
1908 |
|
1909 |
|
1909 |
case PKT_TYPE_AUDIO: |
1910 |
case PKT_TYPE_AUDIO: |
1910 |
sm = SM_FORM2 | SM_REALT | SM_AUDIO; |
1911 |
sm = SM_FORM2 | SM_REALT | SM_AUDIO; |
1911 |
|
1912 |
|
1912 |
ci = CI_AUDIO; |
1913 |
ci = CI_AUDIO; |
1913 |
cn = CN_AUDIO; |
1914 |
cn = CN_AUDIO; |
1914 |
break; |
1915 |
break; |
Lines 1938-1944
Link Here
|
1938 |
|
1939 |
|
1939 |
if (_need_eor) |
1940 |
if (_need_eor) |
1940 |
{ |
1941 |
{ |
1941 |
vcd_debug ("setting EOR for SeqEnd at packet# %d ('%s')", |
1942 |
vcd_debug ("setting EOR for SeqEnd at packet# %d ('%s')", |
1942 |
packet_no, p_segment->id); |
1943 |
packet_no, p_segment->id); |
1943 |
sm |= SM_EOR; |
1944 |
sm |= SM_EOR; |
1944 |
} |
1945 |
} |
Lines 1959-1965
Link Here
|
1959 |
} |
1960 |
} |
1960 |
|
1961 |
|
1961 |
_write_m2_image_sector (p_obj, buf, n, fn, cn, sm, ci); |
1962 |
_write_m2_image_sector (p_obj, buf, n, fn, cn, sm, ci); |
1962 |
|
1963 |
|
1963 |
n++; |
1964 |
n++; |
1964 |
} |
1965 |
} |
1965 |
|
1966 |
|
Lines 1984-1990
Link Here
|
1984 |
_CDIO_LIST_FOREACH (p_node, _mpeg_info->shdr[0].aps_list) |
1985 |
_CDIO_LIST_FOREACH (p_node, _mpeg_info->shdr[0].aps_list) |
1985 |
{ |
1986 |
{ |
1986 |
struct aps_data *_aps = _cdio_list_node_data (p_node); |
1987 |
struct aps_data *_aps = _cdio_list_node_data (p_node); |
1987 |
|
1988 |
|
1988 |
if (first) |
1989 |
if (first) |
1989 |
{ |
1990 |
{ |
1990 |
best_aps = *_aps; |
1991 |
best_aps = *_aps; |
Lines 1992-1998
Link Here
|
1992 |
} |
1993 |
} |
1993 |
else if (fabs (_aps->timestamp - t) < fabs (best_aps.timestamp - t)) |
1994 |
else if (fabs (_aps->timestamp - t) < fabs (best_aps.timestamp - t)) |
1994 |
best_aps = *_aps; |
1995 |
best_aps = *_aps; |
1995 |
else |
1996 |
else |
1996 |
break; |
1997 |
break; |
1997 |
} |
1998 |
} |
1998 |
|
1999 |
|
Lines 2042-2070
Link Here
|
2042 |
int n; |
2043 |
int n; |
2043 |
|
2044 |
|
2044 |
/* generate dir sectors */ |
2045 |
/* generate dir sectors */ |
2045 |
|
2046 |
|
2046 |
_vcd_directory_dump_entries (p_obj->dir, |
2047 |
_vcd_directory_dump_entries (p_obj->dir, |
2047 |
_dict_get_bykey (p_obj, "dir")->buf, |
2048 |
_dict_get_bykey (p_obj, "dir")->buf, |
2048 |
_dict_get_bykey (p_obj, "dir")->sector); |
2049 |
_dict_get_bykey (p_obj, "dir")->sector); |
2049 |
|
2050 |
|
2050 |
_vcd_directory_dump_pathtables (p_obj->dir, |
2051 |
_vcd_directory_dump_pathtables (p_obj->dir, |
2051 |
_dict_get_bykey (p_obj, "ptl")->buf, |
2052 |
_dict_get_bykey (p_obj, "ptl")->buf, |
2052 |
_dict_get_bykey (p_obj, "ptm")->buf); |
2053 |
_dict_get_bykey (p_obj, "ptm")->buf); |
2053 |
|
2054 |
|
2054 |
/* generate PVD and EVD at last... */ |
2055 |
/* generate PVD and EVD at last... */ |
2055 |
iso9660_set_pvd (_dict_get_bykey (p_obj, "pvd")->buf, |
2056 |
iso9660_set_pvd (_dict_get_bykey (p_obj, "pvd")->buf, |
2056 |
p_obj->iso_volume_label, |
2057 |
p_obj->iso_volume_label, |
2057 |
p_obj->iso_publisher_id, |
2058 |
p_obj->iso_publisher_id, |
2058 |
p_obj->iso_preparer_id, |
2059 |
p_obj->iso_preparer_id, |
2059 |
p_obj->iso_application_id, |
2060 |
p_obj->iso_application_id, |
2060 |
p_obj->iso_size, |
2061 |
p_obj->iso_size, |
2061 |
_dict_get_bykey (p_obj, "dir")->buf, |
2062 |
_dict_get_bykey (p_obj, "dir")->buf, |
2062 |
_dict_get_bykey (p_obj, "ptl")->sector, |
2063 |
_dict_get_bykey (p_obj, "ptl")->sector, |
2063 |
_dict_get_bykey (p_obj, "ptm")->sector, |
2064 |
_dict_get_bykey (p_obj, "ptm")->sector, |
2064 |
iso9660_pathtable_get_size (_dict_get_bykey (p_obj, "ptm")->buf), |
2065 |
iso9660_pathtable_get_size (_dict_get_bykey (p_obj, "ptm")->buf), |
2065 |
p_create_time |
2066 |
p_create_time |
2066 |
); |
2067 |
); |
2067 |
|
2068 |
|
2068 |
iso9660_set_evd (_dict_get_bykey (p_obj, "evd")->buf); |
2069 |
iso9660_set_evd (_dict_get_bykey (p_obj, "evd")->buf); |
2069 |
|
2070 |
|
2070 |
/* fill VCD relevant files with data */ |
2071 |
/* fill VCD relevant files with data */ |
Lines 2081-2087
Link Here
|
2081 |
} |
2082 |
} |
2082 |
|
2083 |
|
2083 |
_vcd_pbc_check_unreferenced (p_obj); |
2084 |
_vcd_pbc_check_unreferenced (p_obj); |
2084 |
|
2085 |
|
2085 |
set_lot_vcd (p_obj, _dict_get_bykey (p_obj, "lot")->buf, false); |
2086 |
set_lot_vcd (p_obj, _dict_get_bykey (p_obj, "lot")->buf, false); |
2086 |
set_psd_vcd (p_obj, _dict_get_bykey (p_obj, "psd")->buf, false); |
2087 |
set_psd_vcd (p_obj, _dict_get_bykey (p_obj, "psd")->buf, false); |
2087 |
} |
2088 |
} |
Lines 2105-2111
Link Here
|
2105 |
|
2106 |
|
2106 |
content = _dict_get_sector (p_obj, n); |
2107 |
content = _dict_get_sector (p_obj, n); |
2107 |
flags |= _dict_get_sector_flags (p_obj, n); |
2108 |
flags |= _dict_get_sector_flags (p_obj, n); |
2108 |
|
2109 |
|
2109 |
if (content == NULL) |
2110 |
if (content == NULL) |
2110 |
content = zero; |
2111 |
content = zero; |
2111 |
|
2112 |
|
Lines 2137-2169
Link Here
|
2137 |
|
2138 |
|
2138 |
content = _dict_get_sector (p_obj, n); |
2139 |
content = _dict_get_sector (p_obj, n); |
2139 |
flags |= _dict_get_sector_flags (p_obj, n); |
2140 |
flags |= _dict_get_sector_flags (p_obj, n); |
2140 |
|
2141 |
|
2141 |
if (content == NULL) |
2142 |
if (content == NULL) |
2142 |
{ |
2143 |
{ |
2143 |
vcd_debug ("unexpected empty EXT sector"); |
2144 |
vcd_debug ("unexpected empty EXT sector"); |
2144 |
content = zero; |
2145 |
content = zero; |
2145 |
} |
2146 |
} |
2146 |
|
2147 |
|
2147 |
_write_m2_image_sector (p_obj, content, n, fileno, 0, flags, 0); |
2148 |
_write_m2_image_sector (p_obj, content, n, fileno, 0, flags, 0); |
2148 |
} |
2149 |
} |
2149 |
|
2150 |
|
2150 |
/* write custom files */ |
2151 |
/* write custom files */ |
2151 |
|
2152 |
|
2152 |
vcd_assert (n == p_obj->custom_file_start_extent); |
2153 |
vcd_assert (n == p_obj->custom_file_start_extent); |
2153 |
|
2154 |
|
2154 |
_CDIO_LIST_FOREACH (node, p_obj->custom_file_list) |
2155 |
_CDIO_LIST_FOREACH (node, p_obj->custom_file_list) |
2155 |
{ |
2156 |
{ |
2156 |
custom_file_t *p = _cdio_list_node_data (node); |
2157 |
custom_file_t *p = _cdio_list_node_data (node); |
2157 |
|
2158 |
|
2158 |
vcd_info ("writing file `%s' (%lu bytes%s)", |
2159 |
vcd_info ("writing file `%s' (%lu bytes%s)", |
2159 |
p->iso_pathname, (unsigned long) p->size, |
2160 |
p->iso_pathname, (unsigned long) p->size, |
2160 |
p->raw_flag ? ", raw sectors file": ""); |
2161 |
p->raw_flag ? ", raw sectors file": ""); |
2161 |
if (p->raw_flag) |
2162 |
if (p->raw_flag) |
2162 |
_write_source_mode2_raw (p_obj, p->file, p->start_extent); |
2163 |
_write_source_mode2_raw (p_obj, p->file, p->start_extent); |
2163 |
else |
2164 |
else |
2164 |
_write_source_mode2_form1 (p_obj, p->file, p->start_extent); |
2165 |
_write_source_mode2_form1 (p_obj, p->file, p->start_extent); |
2165 |
} |
2166 |
} |
2166 |
|
2167 |
|
2167 |
/* blank unalloced tracks */ |
2168 |
/* blank unalloced tracks */ |
2168 |
while ((n = _vcd_salloc (p_obj->iso_bitmap, SECTOR_NIL, 1)) < p_obj->iso_size) |
2169 |
while ((n = _vcd_salloc (p_obj->iso_bitmap, SECTOR_NIL, 1)) < p_obj->iso_size) |
2169 |
_write_m2_image_sector (p_obj, zero, n, 0, 0, SM_DATA, 0); |
2170 |
_write_m2_image_sector (p_obj, zero, n, 0, 0, SM_DATA, 0); |
Lines 2178-2185
Link Here
|
2178 |
long size_sectors = -1; |
2179 |
long size_sectors = -1; |
2179 |
|
2180 |
|
2180 |
vcd_assert (!p_obj->in_output); |
2181 |
vcd_assert (!p_obj->in_output); |
2181 |
|
2182 |
|
2182 |
if (_cdio_list_length (p_obj->mpeg_sequence_list) > 0) |
2183 |
if (_cdio_list_length (p_obj->mpeg_sequence_list) > 0) |
2183 |
{ |
2184 |
{ |
2184 |
/* fixme -- make this efficient */ |
2185 |
/* fixme -- make this efficient */ |
2185 |
size_sectors = vcd_obj_begin_output (p_obj); |
2186 |
size_sectors = vcd_obj_begin_output (p_obj); |
Lines 2218-2224
Link Here
|
2218 |
image_size += p_obj->leadout_pregap; |
2219 |
image_size += p_obj->leadout_pregap; |
2219 |
|
2220 |
|
2220 |
if (image_size > CDIO_CD_MAX_SECTORS) |
2221 |
if (image_size > CDIO_CD_MAX_SECTORS) |
2221 |
vcd_error ("image too big (%d sectors > %d sectors)", |
2222 |
vcd_error ("image too big (%d sectors > %d sectors)", |
2222 |
(unsigned) image_size, (unsigned) CDIO_CD_MAX_SECTORS); |
2223 |
(unsigned) image_size, (unsigned) CDIO_CD_MAX_SECTORS); |
2223 |
|
2224 |
|
2224 |
{ |
2225 |
{ |
Lines 2226-2232
Link Here
|
2226 |
|
2227 |
|
2227 |
if (image_size > CDIO_CD_74MIN_SECTORS) |
2228 |
if (image_size > CDIO_CD_74MIN_SECTORS) |
2228 |
vcd_warn ("generated image (%d sectors [%s]) may not fit " |
2229 |
vcd_warn ("generated image (%d sectors [%s]) may not fit " |
2229 |
"on 74min CDRs (%d sectors)", |
2230 |
"on 74min CDRs (%d sectors)", |
2230 |
(unsigned) image_size, _tmp, (unsigned) CDIO_CD_74MIN_SECTORS); |
2231 |
(unsigned) image_size, _tmp, (unsigned) CDIO_CD_74MIN_SECTORS); |
2231 |
|
2232 |
|
2232 |
free (_tmp); |
2233 |
free (_tmp); |
Lines 2248-2254
Link Here
|
2248 |
_vcd_salloc_destroy (p_obj->iso_bitmap); |
2249 |
_vcd_salloc_destroy (p_obj->iso_bitmap); |
2249 |
|
2250 |
|
2250 |
_dict_clean (p_obj); |
2251 |
_dict_clean (p_obj); |
2251 |
_cdio_list_free (p_obj->buffer_dict_list, true); |
2252 |
_cdio_list_free (p_obj->buffer_dict_list, true, NULL); |
2252 |
} |
2253 |
} |
2253 |
|
2254 |
|
2254 |
int |
2255 |
int |
Lines 2268-2274
Link Here
|
2268 |
vcd_error ("item id (%s) exists already", p_pbc->item_id); |
2269 |
vcd_error ("item id (%s) exists already", p_pbc->item_id); |
2269 |
return -1; |
2270 |
return -1; |
2270 |
} |
2271 |
} |
2271 |
|
2272 |
|
2272 |
_cdio_list_append (p_obj->pbc_list, p_pbc); |
2273 |
_cdio_list_append (p_obj->pbc_list, p_pbc); |
2273 |
|
2274 |
|
2274 |
return 0; |
2275 |
return 0; |
Lines 2305-2318
Link Here
|
2305 |
mpeg_sequence_t *p_track = _cdio_list_node_data (node); |
2306 |
mpeg_sequence_t *p_track = _cdio_list_node_data (node); |
2306 |
CdioListNode_t *p_entry_node; |
2307 |
CdioListNode_t *p_entry_node; |
2307 |
|
2308 |
|
2308 |
_cdio_list_append (p_cue_list, |
2309 |
_cdio_list_append (p_cue_list, |
2309 |
(p_cue = calloc(1, sizeof (vcd_cue_t)))); |
2310 |
(p_cue = calloc(1, sizeof (vcd_cue_t)))); |
2310 |
|
2311 |
|
2311 |
p_cue->lsn = p_track->relative_start_extent + p_obj->iso_size; |
2312 |
p_cue->lsn = p_track->relative_start_extent + p_obj->iso_size; |
2312 |
p_cue->lsn -= p_obj->track_pregap; |
2313 |
p_cue->lsn -= p_obj->track_pregap; |
2313 |
p_cue->type = VCD_CUE_PREGAP_START; |
2314 |
p_cue->type = VCD_CUE_PREGAP_START; |
2314 |
|
2315 |
|
2315 |
_cdio_list_append (p_cue_list, |
2316 |
_cdio_list_append (p_cue_list, |
2316 |
(p_cue = calloc(1, sizeof (vcd_cue_t)))); |
2317 |
(p_cue = calloc(1, sizeof (vcd_cue_t)))); |
2317 |
|
2318 |
|
2318 |
p_cue->lsn = p_track->relative_start_extent + p_obj->iso_size; |
2319 |
p_cue->lsn = p_track->relative_start_extent + p_obj->iso_size; |
Lines 2322-2330
Link Here
|
2322 |
{ |
2323 |
{ |
2323 |
entry_t *_entry = _cdio_list_node_data (p_entry_node); |
2324 |
entry_t *_entry = _cdio_list_node_data (p_entry_node); |
2324 |
|
2325 |
|
2325 |
_cdio_list_append (p_cue_list, |
2326 |
_cdio_list_append (p_cue_list, |
2326 |
(p_cue = calloc(1, sizeof (vcd_cue_t)))); |
2327 |
(p_cue = calloc(1, sizeof (vcd_cue_t)))); |
2327 |
|
2328 |
|
2328 |
p_cue->lsn = p_obj->iso_size; |
2329 |
p_cue->lsn = p_obj->iso_size; |
2329 |
p_cue->lsn += p_track->relative_start_extent; |
2330 |
p_cue->lsn += p_track->relative_start_extent; |
2330 |
p_cue->lsn += p_obj->track_front_margin; |
2331 |
p_cue->lsn += p_obj->track_front_margin; |
Lines 2348-2354
Link Here
|
2348 |
|
2349 |
|
2349 |
vcd_image_sink_set_cuesheet (p_image_sink, p_cue_list); |
2350 |
vcd_image_sink_set_cuesheet (p_image_sink, p_cue_list); |
2350 |
|
2351 |
|
2351 |
_cdio_list_free (p_cue_list, true); |
2352 |
_cdio_list_free (p_cue_list, true, NULL); |
2352 |
} |
2353 |
} |
2353 |
|
2354 |
|
2354 |
/* and now for the pay load */ |
2355 |
/* and now for the pay load */ |
Lines 2364-2370
Link Here
|
2364 |
p_obj->progress_callback = callback; |
2365 |
p_obj->progress_callback = callback; |
2365 |
p_obj->callback_user_data = user_data; |
2366 |
p_obj->callback_user_data = user_data; |
2366 |
p_obj->image_sink = p_image_sink; |
2367 |
p_obj->image_sink = p_image_sink; |
2367 |
|
2368 |
|
2368 |
if (_callback_wrapper (p_obj, true)) |
2369 |
if (_callback_wrapper (p_obj, true)) |
2369 |
return 1; |
2370 |
return 1; |
2370 |
|
2371 |
|
Lines 2393-2399
Link Here
|
2393 |
int n, lastsect = p_obj->sectors_written; |
2394 |
int n, lastsect = p_obj->sectors_written; |
2394 |
|
2395 |
|
2395 |
vcd_debug ("writting post-gap ('leadout pregap')..."); |
2396 |
vcd_debug ("writting post-gap ('leadout pregap')..."); |
2396 |
|
2397 |
|
2397 |
for (n = 0; n < p_obj->leadout_pregap; n++) |
2398 |
for (n = 0; n < p_obj->leadout_pregap; n++) |
2398 |
_write_m2_image_sector (p_obj, zero, lastsect++, 0, 0, SM_FORM2, 0); |
2399 |
_write_m2_image_sector (p_obj, zero, lastsect++, 0, 0, SM_FORM2, 0); |
2399 |
} |
2400 |
} |
Lines 2402-2413
Link Here
|
2402 |
return 1; |
2403 |
return 1; |
2403 |
|
2404 |
|
2404 |
p_obj->image_sink = NULL; |
2405 |
p_obj->image_sink = NULL; |
2405 |
|
2406 |
|
2406 |
vcd_image_sink_destroy (p_image_sink); |
2407 |
vcd_image_sink_destroy (p_image_sink); |
2407 |
|
2408 |
|
2408 |
return 0; /* ok */ |
2409 |
return 0; /* ok */ |
2409 |
} |
2410 |
} |
2410 |
} |
2411 |
} |
2411 |
|
2412 |
|
2412 |
const char * |
2413 |
const char * |
2413 |
vcd_version_string (bool full_text) |
2414 |
vcd_version_string (bool full_text) |
Lines 2427-2434
Link Here
|
2427 |
"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"); |
2428 |
"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"); |
2428 |
} |
2429 |
} |
2429 |
|
2430 |
|
2430 |
|
2431 |
|
2431 |
/* |
2432 |
/* |
2432 |
* Local variables: |
2433 |
* Local variables: |
2433 |
* c-file-style: "gnu" |
2434 |
* c-file-style: "gnu" |
2434 |
* tab-width: 8 |
2435 |
* tab-width: 8 |