Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
79053042
Commit
79053042
authored
Dec 26, 2004
by
Rocky Bernstein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some cleanup and unification with xine vcd plugin.
parent
8b492795
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
494 additions
and
515 deletions
+494
-515
modules/access/vcdx/access.c
modules/access/vcdx/access.c
+198
-185
modules/access/vcdx/info.c
modules/access/vcdx/info.c
+55
-52
modules/access/vcdx/info.h
modules/access/vcdx/info.h
+1
-1
modules/access/vcdx/intf.c
modules/access/vcdx/intf.c
+11
-10
modules/access/vcdx/intf.h
modules/access/vcdx/intf.h
+1
-1
modules/access/vcdx/vcdplayer.c
modules/access/vcdx/vcdplayer.c
+193
-234
modules/access/vcdx/vcdplayer.h
modules/access/vcdx/vcdplayer.h
+35
-32
No files found.
modules/access/vcdx/access.c
View file @
79053042
...
...
@@ -87,11 +87,11 @@ static access_t *p_vcd_access = NULL;
static
void
cdio_log_handler
(
cdio_log_level_t
level
,
const
char
message
[])
{
const
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_vcd_access
->
p_sys
;
const
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_vcd_access
->
p_sys
;
switch
(
level
)
{
case
CDIO_LOG_DEBUG
:
case
CDIO_LOG_INFO
:
if
(
p_vcd
->
i_debug
&
INPUT_DBG_CDIO
)
if
(
p_vcd
player
->
i_debug
&
INPUT_DBG_CDIO
)
msg_Dbg
(
p_vcd_access
,
message
);
break
;
case
CDIO_LOG_WARN
:
...
...
@@ -113,11 +113,11 @@ cdio_log_handler (cdio_log_level_t level, const char message[])
static
void
vcd_log_handler
(
vcd_log_level_t
level
,
const
char
message
[])
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_vcd_access
->
p_sys
;
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_vcd_access
->
p_sys
;
switch
(
level
)
{
case
VCD_LOG_DEBUG
:
case
VCD_LOG_INFO
:
if
(
p_vcd
->
i_debug
&
INPUT_DBG_VCDINFO
)
if
(
p_vcd
player
->
i_debug
&
INPUT_DBG_VCDINFO
)
msg_Dbg
(
p_vcd_access
,
message
);
break
;
case
VCD_LOG_WARN
:
...
...
@@ -142,16 +142,16 @@ vcd_log_handler (vcd_log_level_t level, const char message[])
static
block_t
*
VCDReadBlock
(
access_t
*
p_access
)
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdplayer_t
*
p_vcdplayer
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
const
int
i_blocks
=
p_vcdplayer
->
i_blocks_per_read
;
block_t
*
p_block
;
const
int
i_blocks
=
p_vcd
->
i_blocks_per_read
;
int
i_read
;
uint8_t
*
p_buf
;
int
i_read
;
uint8_t
*
p_buf
;
i_read
=
0
;
dbg_print
(
(
INPUT_DBG_LSN
),
"lsn: %lu"
,
(
long
unsigned
int
)
p_vcd
->
i_lsn
);
(
long
unsigned
int
)
p_vcd
player
->
i_lsn
);
/* Allocate a block for the reading */
if
(
!
(
p_block
=
block_New
(
p_access
,
i_blocks
*
M2F2_SECTOR_SIZE
)
)
)
...
...
@@ -213,7 +213,7 @@ VCDReadBlock( access_t * p_access )
p_vcd->in_still = VLC_FALSE;
dbg_print(INPUT_DBG_STILL, "still wait time done");
#else
vcdIntfStillTime
(
p_vcd
->
p_intf
,
*
p_buf
);
vcdIntfStillTime
(
p_vcd
player
->
p_intf
,
*
p_buf
);
#endif
#if 1
...
...
@@ -235,16 +235,17 @@ VCDReadBlock( access_t * p_access )
p_buf
+=
M2F2_SECTOR_SIZE
;
/* Update seekpoint */
if
(
VCDINFO_ITEM_TYPE_ENTRY
==
p_vcd
->
play_item
.
type
)
if
(
VCDINFO_ITEM_TYPE_ENTRY
==
p_vcd
player
->
play_item
.
type
)
{
unsigned
int
i_entry
=
p_vcd
->
play_item
.
num
+
1
;
lsn_t
i_lsn
=
vcdinfo_get_entry_lba
(
p_vcd
->
vcd
,
i_entry
);
if
(
p_vcd
->
i_lsn
>=
i_lsn
&&
i_lsn
!=
VCDINFO_NULL_LBA
)
unsigned
int
i_entry
=
p_vcd
player
->
play_item
.
num
+
1
;
lsn_t
i_lsn
=
vcdinfo_get_entry_lba
(
p_vcd
player
->
vcd
,
i_entry
);
if
(
p_vcd
player
->
i_lsn
>=
i_lsn
&&
i_lsn
!=
VCDINFO_NULL_LBA
)
{
const
track_t
i_track
=
p_vcd
->
i_track
;
p_vcd
->
play_item
.
num
=
i_entry
;
const
track_t
i_track
=
p_vcd
player
->
i_track
;
p_vcd
player
->
play_item
.
num
=
i_entry
;
dbg_print
(
(
INPUT_DBG_LSN
|
INPUT_DBG_PBC
),
"entry change"
);
VCDSetOrigin
(
p_access
,
i_lsn
,
i_track
,
&
(
p_vcd
->
play_item
)
);
VCDSetOrigin
(
p_access
,
i_lsn
,
i_track
,
&
(
p_vcdplayer
->
play_item
)
);
}
}
}
...
...
@@ -262,30 +263,30 @@ VCDSeek( access_t * p_access, int64_t i_pos )
if
(
!
p_access
||
!
p_access
->
p_sys
)
return
VLC_EGENERIC
;
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_vcd_access
->
p_sys
;
const
input_title_t
*
t
=
p_vcd
->
p_title
[
p_access
->
info
.
i_title
];
vcdplayer_t
*
p_vcdplayer
=
(
vcdplayer_t
*
)
p_vcd_access
->
p_sys
;
const
input_title_t
*
t
=
p_vcdplayer
->
p_title
[
p_access
->
info
.
i_title
];
unsigned
int
i_entry
=
VCDINFO_INVALID_ENTRY
;
int
i_seekpoint
;
unsigned
int
i_entry
=
VCDINFO_INVALID_ENTRY
;
/* Next sector to read */
p_access
->
info
.
i_pos
=
i_pos
;
p_vcd
->
i_lsn
=
(
i_pos
/
(
int64_t
)
M2F2_SECTOR_SIZE
)
+
p_vcd
->
track_lsn
;
p_vcd
player
->
i_lsn
=
(
i_pos
/
(
int64_t
)
M2F2_SECTOR_SIZE
)
+
p_vcd
player
->
track_lsn
;
switch
(
p_vcd
->
play_item
.
type
)
{
switch
(
p_vcd
player
->
play_item
.
type
)
{
case
VCDINFO_ITEM_TYPE_TRACK
:
case
VCDINFO_ITEM_TYPE_ENTRY
:
break
;
default:
p_vcd
->
b_valid_ep
=
VLC_FALSE
;
p_vcd
player
->
b_valid_ep
=
VLC_FALSE
;
}
/* Find entry */
if
(
p_vcd
->
b_valid_ep
)
if
(
p_vcd
player
->
b_valid_ep
)
{
for
(
i_entry
=
0
;
i_entry
<
p_vcd
->
i_entries
;
i_entry
++
)
for
(
i_entry
=
0
;
i_entry
<
p_vcd
player
->
i_entries
;
i_entry
++
)
{
if
(
p_vcd
->
i_lsn
<
p_vcd
->
p_entries
[
i_entry
]
)
if
(
p_vcd
player
->
i_lsn
<
p_vcdplayer
->
p_entries
[
i_entry
]
)
{
VCDUpdateVar
(
p_access
,
i_entry
,
VLC_VAR_SETVALUE
,
"chapter"
,
_
(
"Entry"
),
"Setting entry"
);
...
...
@@ -297,15 +298,15 @@ VCDSeek( access_t * p_access, int64_t i_pos )
vcdinfo_itemid_t
itemid
;
itemid
.
num
=
i_entry
;
itemid
.
type
=
VCDINFO_ITEM_TYPE_ENTRY
;
VCDSetOrigin
(
p_access
,
p_vcd
->
i_lsn
,
p_vcd
->
i_track
,
VCDSetOrigin
(
p_access
,
p_vcd
player
->
i_lsn
,
p_vcdplayer
->
i_track
,
&
itemid
);
}
}
dbg_print
(
(
INPUT_DBG_CALL
|
INPUT_DBG_EXT
|
INPUT_DBG_SEEK
),
"orig %lu, cur: %lu, offset: %lld, entry %d"
,
(
long
unsigned
int
)
p_vcd
->
origin_lsn
,
(
long
unsigned
int
)
p_vcd
->
i_lsn
,
i_pos
,
(
long
unsigned
int
)
p_vcd
player
->
origin_lsn
,
(
long
unsigned
int
)
p_vcd
player
->
i_lsn
,
i_pos
,
i_entry
);
/* Find seekpoint */
...
...
@@ -340,11 +341,12 @@ VCDEntryPoints( access_t * p_access )
if
(
!
p_access
||
!
p_access
->
p_sys
)
return
VLC_FALSE
;
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
const
unsigned
int
i_entries
=
vcdinfo_get_num_entries
(
p_vcd
->
vcd
);
vcdplayer_t
*
p_vcdplayer
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
const
unsigned
int
i_entries
=
vcdinfo_get_num_entries
(
p_vcdplayer
->
vcd
);
const
track_t
i_last_track
=
cdio_get_num_tracks
(
vcdinfo_get_cd_image
(
p_vcd
->
vcd
))
+
cdio_get_first_track_num
(
vcdinfo_get_cd_image
(
p_vcd
->
vcd
));
=
cdio_get_num_tracks
(
vcdinfo_get_cd_image
(
p_vcd
player
->
vcd
))
+
cdio_get_first_track_num
(
vcdinfo_get_cd_image
(
p_vcd
player
->
vcd
));
unsigned
int
i
;
if
(
0
==
i_entries
)
{
...
...
@@ -352,43 +354,43 @@ VCDEntryPoints( access_t * p_access )
return
VLC_FALSE
;
}
p_vcd
->
p_entries
=
malloc
(
sizeof
(
lsn_t
)
*
i_entries
);
p_vcd
player
->
p_entries
=
malloc
(
sizeof
(
lsn_t
)
*
i_entries
);
if
(
p_vcd
->
p_entries
==
NULL
)
if
(
p_vcd
player
->
p_entries
==
NULL
)
{
LOG_ERR
(
"not enough memory for entry points treatment"
);
return
VLC_FALSE
;
}
p_vcd
->
i_entries
=
i_entries
;
p_vcd
player
->
i_entries
=
i_entries
;
for
(
i
=
0
;
i
<
i_entries
;
i
++
)
{
const
track_t
i_track
=
vcdinfo_get_track
(
p_vcd
->
vcd
,
i
);
const
track_t
i_track
=
vcdinfo_get_track
(
p_vcd
player
->
vcd
,
i
);
if
(
i_track
<=
i_last_track
)
{
seekpoint_t
*
s
=
vlc_seekpoint_New
();
char
psz_entry
[
100
];
snprintf
(
psz_entry
,
sizeof
(
psz_entry
),
"%s%02d"
,
_
(
"Entry "
),
i
);
p_vcd
->
p_entries
[
i
]
=
vcdinfo_get_entry_lba
(
p_vcd
->
vcd
,
i
);
p_vcd
player
->
p_entries
[
i
]
=
vcdinfo_get_entry_lba
(
p_vcdplayer
->
vcd
,
i
);
s
->
psz_name
=
strdup
(
psz_entry
);
s
->
i_byte_offset
=
(
p_vcd
->
p_entries
[
i
]
-
vcdinfo_get_track_lba
(
p_vcd
->
vcd
,
i_track
))
(
p_vcd
player
->
p_entries
[
i
]
-
vcdinfo_get_track_lba
(
p_vcdplayer
->
vcd
,
i_track
))
*
M2F2_SECTOR_SIZE
;
dbg_print
(
INPUT_DBG_MRL
,
"%s, lsn %d, byte_offset %ld"
,
s
->
psz_name
,
p_vcd
->
p_entries
[
i
],
s
->
psz_name
,
p_vcd
player
->
p_entries
[
i
],
(
unsigned
long
int
)
s
->
i_byte_offset
);
TAB_APPEND
(
p_vcd
->
p_title
[
i_track
-
1
]
->
i_seekpoint
,
p_vcd
->
p_title
[
i_track
-
1
]
->
seekpoint
,
s
);
TAB_APPEND
(
p_vcd
player
->
p_title
[
i_track
-
1
]
->
i_seekpoint
,
p_vcd
player
->
p_title
[
i_track
-
1
]
->
seekpoint
,
s
);
}
else
msg_Warn
(
p_access
,
"wrong track number found in entry points"
);
}
p_vcd
->
b_valid_ep
=
VLC_TRUE
;
p_vcd
player
->
b_valid_ep
=
VLC_TRUE
;
return
VLC_TRUE
;
}
}
...
...
@@ -399,19 +401,19 @@ VCDEntryPoints( access_t * p_access )
static
vlc_bool_t
VCDSegments
(
access_t
*
p_access
)
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
unsigned
int
i
;
vcdplayer_t
*
p_vcdplayer
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
unsigned
int
i
;
input_title_t
*
t
;
p_vcd
->
i_segments
=
vcdinfo_get_num_segments
(
p_vcd
->
vcd
);
p_vcd
player
->
i_segments
=
vcdinfo_get_num_segments
(
p_vcdplayer
->
vcd
);
dbg_print
(
(
INPUT_DBG_CALL
|
INPUT_DBG_MRL
),
"Segments: %d"
,
p_vcd
->
i_segments
);
"Segments: %d"
,
p_vcd
player
->
i_segments
);
if
(
0
==
p_vcd
->
i_segments
)
return
VLC_FALSE
;
if
(
0
==
p_vcd
player
->
i_segments
)
return
VLC_FALSE
;
t
=
p_vcd
->
p_title
[
p_vcd
->
i_titles
]
=
vlc_input_title_New
();
p_vcd
->
i_titles
++
;
t
=
p_vcd
player
->
p_title
[
p_vcdplayer
->
i_titles
]
=
vlc_input_title_New
();
p_vcd
player
->
i_titles
++
;
t
->
i_size
=
0
;
/* Not sure Segments have a size associated */
t
->
psz_name
=
strdup
(
_
(
"Segments"
));
...
...
@@ -419,18 +421,19 @@ VCDSegments( access_t * p_access )
/* We have one additional segment allocated so we can get the size
by subtracting seg[i+1] - seg[i].
*/
p_vcd
->
p_segments
=
malloc
(
sizeof
(
lsn_t
)
*
(
p_vcd
->
i_segments
+
1
)
);
if
(
p_vcd
->
p_segments
==
NULL
)
p_vcdplayer
->
p_segments
=
malloc
(
sizeof
(
lsn_t
)
*
(
p_vcdplayer
->
i_segments
+
1
)
);
if
(
p_vcdplayer
->
p_segments
==
NULL
)
{
LOG_ERR
(
"not enough memory for segment treatment"
);
return
VLC_FALSE
;
}
for
(
i
=
0
;
i
<
p_vcd
->
i_segments
;
i
++
)
for
(
i
=
0
;
i
<
p_vcd
player
->
i_segments
;
i
++
)
{
char
psz_segment
[
100
];
seekpoint_t
*
s
=
vlc_seekpoint_New
();
p_vcd
->
p_segments
[
i
]
=
vcdinfo_get_seg_lsn
(
p_vcd
->
vcd
,
i
);
p_vcd
player
->
p_segments
[
i
]
=
vcdinfo_get_seg_lsn
(
p_vcdplayer
->
vcd
,
i
);
snprintf
(
psz_segment
,
sizeof
(
psz_segment
),
"%s%02d"
,
_
(
"Segment "
),
i
);
...
...
@@ -440,9 +443,10 @@ VCDSegments( access_t * p_access )
TAB_APPEND
(
t
->
i_seekpoint
,
t
->
seekpoint
,
s
);
}
p_vcd
->
p_segments
[
p_vcd
->
i_segments
]
=
p_vcd
->
p_segments
[
p_vcd
->
i_segments
-
1
]
+
vcdinfo_get_seg_sector_count
(
p_vcd
->
vcd
,
p_vcd
->
i_segments
-
1
);
p_vcdplayer
->
p_segments
[
p_vcdplayer
->
i_segments
]
=
p_vcdplayer
->
p_segments
[
p_vcdplayer
->
i_segments
-
1
]
+
vcdinfo_get_seg_sector_count
(
p_vcdplayer
->
vcd
,
p_vcdplayer
->
i_segments
-
1
);
return
VLC_TRUE
;
}
...
...
@@ -465,15 +469,17 @@ VCDTitles( access_t * p_access )
if
(
!
p_access
||
!
p_access
->
p_sys
)
return
VLC_EGENERIC
;
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
track_t
i
;
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
track_t
i
;
p_vcd
->
i_titles
=
0
;
for
(
i
=
1
;
i
<=
p_vcd
->
i_tracks
;
i
++
)
p_vcd
player
->
i_titles
=
0
;
for
(
i
=
1
;
i
<=
p_vcd
player
->
i_tracks
;
i
++
)
{
input_title_t
*
t
=
p_vcd
->
p_title
[
i
-
1
]
=
vlc_input_title_New
();
input_title_t
*
t
=
p_vcdplayer
->
p_title
[
i
-
1
]
=
vlc_input_title_New
();
char
psz_track
[
100
];
uint32_t
i_secsize
=
vcdinfo_get_track_sect_count
(
p_vcd
->
vcd
,
i
);
uint32_t
i_secsize
=
vcdinfo_get_track_sect_count
(
p_vcdplayer
->
vcd
,
i
);
snprintf
(
psz_track
,
sizeof
(
psz_track
),
"%s%02d"
,
_
(
"Track "
),
i
);
...
...
@@ -484,7 +490,7 @@ VCDTitles( access_t * p_access )
dbg_print
(
INPUT_DBG_MRL
,
"track[%d] i_size: %lld"
,
i
,
t
->
i_size
);
p_vcd
->
i_titles
++
;
p_vcd
player
->
i_titles
++
;
}
return
VLC_SUCCESS
;
...
...
@@ -497,21 +503,21 @@ VCDTitles( access_t * p_access )
static
vlc_bool_t
VCDLIDs
(
access_t
*
p_access
)
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdplayer_t
*
p_vcdplayer
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
input_title_t
*
t
;
unsigned
int
i_lid
,
i_title
;
unsigned
int
i_lid
,
i_title
;
p_vcd
->
i_lids
=
vcdinfo_get_num_LIDs
(
p_vcd
->
vcd
);
p_vcd
->
i_lid
=
VCDINFO_INVALID_ENTRY
;
p_vcd
player
->
i_lids
=
vcdinfo_get_num_LIDs
(
p_vcdplayer
->
vcd
);
p_vcd
player
->
i_lid
=
VCDINFO_INVALID_ENTRY
;
dbg_print
(
(
INPUT_DBG_CALL
|
INPUT_DBG_MRL
),
"LIDs: %d"
,
p_vcd
->
i_lids
);
"LIDs: %d"
,
p_vcd
player
->
i_lids
);
if
(
0
==
p_vcd
->
i_lids
)
return
VLC_FALSE
;
if
(
0
==
p_vcd
player
->
i_lids
)
return
VLC_FALSE
;
if
(
vcdinfo_read_psd
(
p_vcd
->
vcd
))
{
if
(
vcdinfo_read_psd
(
p_vcd
player
->
vcd
))
{
vcdinfo_visit_lot
(
p_vcd
->
vcd
,
VLC_FALSE
);
vcdinfo_visit_lot
(
p_vcd
player
->
vcd
,
VLC_FALSE
);
#if FIXED
/*
...
...
@@ -520,8 +526,8 @@ VCDLIDs( access_t * p_access )
selection features in the extended PSD haven't been implemented,
it's best then to not try to read this at all.
*/
if
(
vcdinfo_get_psd_x_size
(
p_vcd
->
vcd
))
vcdinfo_visit_lot
(
p_vcd
->
vcd
,
VLC_TRUE
);
if
(
vcdinfo_get_psd_x_size
(
p_vcd
player
->
vcd
))
vcdinfo_visit_lot
(
p_vcd
player
->
vcd
,
VLC_TRUE
);
#endif
}
...
...
@@ -530,8 +536,8 @@ VCDLIDs( access_t * p_access )
t
->
b_menu
=
VLC_TRUE
;
t
->
psz_name
=
strdup
(
"LIDs"
);
i_title
=
p_vcd
->
i_tracks
;
for
(
i_lid
=
1
;
i_lid
<=
p_vcd
->
i_lids
;
i_lid
++
)
i_title
=
p_vcd
player
->
i_tracks
;
for
(
i_lid
=
1
;
i_lid
<=
p_vcd
player
->
i_lids
;
i_lid
++
)
{
char
psz_lid
[
100
];
seekpoint_t
*
s
=
vlc_seekpoint_New
();
...
...
@@ -547,10 +553,10 @@ VCDLIDs( access_t * p_access )
}
#if DYNAMICALLY_ALLOCATED
TAB_APPEND
(
p_vcd
->
i_titles
,
p_vcd
->
p_title
,
t
);
TAB_APPEND
(
p_vcd
player
->
i_titles
,
p_vcdplayer
->
p_title
,
t
);
#else
p_vcd
->
p_title
[
p_vcd
->
i_titles
]
=
t
;
p_vcd
->
i_titles
++
;
p_vcd
player
->
p_title
[
p_vcdplayer
->
i_titles
]
=
t
;
p_vcd
player
->
i_titles
++
;
#endif
return
VLC_TRUE
;
...
...
@@ -563,7 +569,7 @@ static char *
VCDParse
(
access_t
*
p_access
,
/*out*/
vcdinfo_itemid_t
*
p_itemid
,
/*out*/
vlc_bool_t
*
play_single_item
)
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
char
*
psz_parser
;
char
*
psz_source
;
char
*
psz_next
;
...
...
@@ -683,7 +689,7 @@ void
VCDSetOrigin
(
access_t
*
p_access
,
lsn_t
i_lsn
,
track_t
i_track
,
const
vcdinfo_itemid_t
*
p_itemid
)
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
dbg_print
(
(
INPUT_DBG_CALL
|
INPUT_DBG_LSN
),
"i_lsn: %lu, track: %d"
,
(
long
unsigned
int
)
i_lsn
,
...
...
@@ -691,18 +697,18 @@ VCDSetOrigin( access_t *p_access, lsn_t i_lsn, track_t i_track,
vcdplayer_set_origin
(
p_access
,
i_lsn
,
i_track
,
p_itemid
);
p_access
->
info
.
i_pos
=
(
i_lsn
-
p_vcd
->
track_lsn
)
p_access
->
info
.
i_pos
=
(
i_lsn
-
p_vcdplayer
->
track_lsn
)
*
M2F2_SECTOR_SIZE
;
p_access
->
info
.
i_update
|=
INPUT_UPDATE_TITLE
|
INPUT_UPDATE_SIZE
|
INPUT_UPDATE_SEEKPOINT
;
p_access
->
info
.
i_update
|=
INPUT_UPDATE_TITLE
|
INPUT_UPDATE_SIZE
|
INPUT_UPDATE_SEEKPOINT
;
switch
(
p_vcd
->
play_item
.
type
)
{
switch
(
p_vcd
player
->
play_item
.
type
)
{
case
VCDINFO_ITEM_TYPE_ENTRY
:
VCDUpdateVar
(
p_access
,
p_itemid
->
num
,
VLC_VAR_SETVALUE
,
"chapter"
,
_
(
"Entry"
),
"Setting entry/segment"
);
p_access
->
info
.
i_title
=
i_track
-
1
;
p_access
->
info
.
i_size
=
p_vcd
->
p_title
[
i_track
-
1
]
->
i_size
;
p_access
->
info
.
i_size
=
p_vcd
player
->
p_title
[
i_track
-
1
]
->
i_size
;
p_access
->
info
.
i_seekpoint
=
p_itemid
->
num
;
break
;
...
...
@@ -713,21 +719,21 @@ VCDSetOrigin( access_t *p_access, lsn_t i_lsn, track_t i_track,
and they must here. The segment seekpoints are stored after
the entry seekpoints and (zeroed) lid seekpoints.
*/
p_access
->
info
.
i_title
=
p_vcd
->
i_titles
-
1
;
p_access
->
info
.
i_title
=
p_vcd
player
->
i_titles
-
1
;
p_access
->
info
.
i_size
=
150
*
M2F2_SECTOR_SIZE
;
p_access
->
info
.
i_seekpoint
=
p_vcd
->
i_entries
+
p_vcd
->
i_lids
+
p_itemid
->
num
;
p_access
->
info
.
i_seekpoint
=
p_vcd
player
->
i_entries
+
p_vcd
player
->
i_lids
+
p_itemid
->
num
;
break
;
case
VCDINFO_ITEM_TYPE_TRACK
:
p_access
->
info
.
i_title
=
i_track
-
1
;
p_access
->
info
.
i_size
=
p_vcd
->
p_title
[
i_track
-
1
]
->
i_size
;
p_access
->
info
.
i_seekpoint
=
vcdinfo_track_get_entry
(
p_vcd
->
vcd
,
p_access
->
info
.
i_size
=
p_vcd
player
->
p_title
[
i_track
-
1
]
->
i_size
;
p_access
->
info
.
i_seekpoint
=
vcdinfo_track_get_entry
(
p_vcd
player
->
vcd
,
i_track
);
break
;
default:
msg_Warn
(
p_access
,
"can't set origin for play type %d"
,
p_vcd
->
play_item
.
type
);
p_vcd
player
->
play_item
.
type
);
}
...
...
@@ -743,7 +749,7 @@ static vcdinfo_obj_t *
vcd_Open
(
vlc_object_t
*
p_this
,
const
char
*
psz_dev
)
{
access_t
*
p_access
=
(
access_t
*
)
p_this
;
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdinfo_obj_t
*
p_vcdobj
;
char
*
actual_dev
;
unsigned
int
i
;
...
...
@@ -764,41 +770,43 @@ vcd_Open( vlc_object_t *p_this, const char *psz_dev )
Save summary info on tracks, segments and entries...
*/
if
(
0
<
(
p_vcd
->
i_tracks
=
vcdinfo_get_num_tracks
(
p_vcdobj
))
)
{
p_vcd
->
track
=
(
vcdplayer_play_item_info_t
*
)
calloc
(
p_vcd
->
i_tracks
,
sizeof
(
vcdplayer_play_item_info_t
));
if
(
0
<
(
p_vcd
player
->
i_tracks
=
vcdinfo_get_num_tracks
(
p_vcdobj
))
)
{
p_vcd
player
->
track
=
(
vcdplayer_play_item_info_t
*
)
calloc
(
p_vcd
player
->
i_tracks
,
sizeof
(
vcdplayer_play_item_info_t
));
for
(
i
=
0
;
i
<
p_vcd
->
i_tracks
;
i
++
)
{
for
(
i
=
0
;
i
<
p_vcd
player
->
i_tracks
;
i
++
)
{
unsigned
int
track_num
=
i
+
1
;
p_vcd
->
track
[
i
].
size
=
p_vcd
player
->
track
[
i
].
size
=
vcdinfo_get_track_sect_count
(
p_vcdobj
,
track_num
);
p_vcd
->
track
[
i
].
start_LSN
=
p_vcd
player
->
track
[
i
].
start_LSN
=
vcdinfo_get_track_lba
(
p_vcdobj
,
track_num
);
}
}
else
p_vcd
->
track
=
NULL
;
p_vcd
player
->
track
=
NULL
;
if
(
0
<
(
p_vcd
->
i_entries
=
vcdinfo_get_num_entries
(
p_vcdobj
))
)
{
p_vcd
->
entry
=
(
vcdplayer_play_item_info_t
*
)
calloc
(
p_vcd
->
i_entries
,
sizeof
(
vcdplayer_play_item_info_t
));
if
(
0
<
(
p_vcd
player
->
i_entries
=
vcdinfo_get_num_entries
(
p_vcdobj
))
)
{
p_vcd
player
->
entry
=
(
vcdplayer_play_item_info_t
*
)
calloc
(
p_vcd
player
->
i_entries
,
sizeof
(
vcdplayer_play_item_info_t
));
for
(
i
=
0
;
i
<
p_vcd
->
i_entries
;
i
++
)
{
p_vcd
->
entry
[
i
].
size
=
vcdinfo_get_entry_sect_count
(
p_vcdobj
,
i
);
p_vcd
->
entry
[
i
].
start_LSN
=
vcdinfo_get_entry_lba
(
p_vcdobj
,
i
);
for
(
i
=
0
;
i
<
p_vcdplayer
->
i_entries
;
i
++
)
{
p_vcdplayer
->
entry
[
i
].
size
=
vcdinfo_get_entry_sect_count
(
p_vcdobj
,
i
);
p_vcdplayer
->
entry
[
i
].
start_LSN
=
vcdinfo_get_entry_lba
(
p_vcdobj
,
i
);
}
}
else
p_vcd
->
entry
=
NULL
;
p_vcd
player
->
entry
=
NULL
;
if
(
0
<
(
p_vcd
->
i_segments
=
vcdinfo_get_num_segments
(
p_vcdobj
))
)
{
p_vcd
->
segment
=
(
vcdplayer_play_item_info_t
*
)
calloc
(
p_vcd
->
i_segments
,
sizeof
(
vcdplayer_play_item_info_t
));
if
(
0
<
(
p_vcd
player
->
i_segments
=
vcdinfo_get_num_segments
(
p_vcdobj
))
)
{
p_vcd
player
->
segment
=
(
vcdplayer_play_item_info_t
*
)
calloc
(
p_vcd
player
->
i_segments
,
sizeof
(
vcdplayer_play_item_info_t
));
for
(
i
=
0
;
i
<
p_vcd
->
i_segments
;
i
++
)
{
p_vcd
->
segment
[
i
].
size
=
vcdinfo_get_seg_sector_count
(
p_vcdobj
,
i
);
p_vcd
->
segment
[
i
].
start_LSN
=
vcdinfo_get_seg_lsn
(
p_vcdobj
,
i
);
for
(
i
=
0
;
i
<
p_vcdplayer
->
i_segments
;
i
++
)
{
p_vcdplayer
->
segment
[
i
].
size
=
vcdinfo_get_seg_sector_count
(
p_vcdobj
,
i
);
p_vcdplayer
->
segment
[
i
].
start_LSN
=
vcdinfo_get_seg_lsn
(
p_vcdobj
,
i
);
}
}
else
p_vcd
->
segment
=
NULL
;
p_vcd
player
->
segment
=
NULL
;
return
p_vcdobj
;
...
...
@@ -815,7 +823,7 @@ VCDUpdateVar( access_t *p_access, int i_num, int i_action,
vlc_value_t
val
;
val
.
i_int
=
i_num
;
if
(
p_access
)
{
const
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_vcd_access
->
p_sys
;
const
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_vcd_access
->
p_sys
;
dbg_print
(
INPUT_DBG_PBC
,
"%s %d"
,
p_debug_label
,
i_num
);
}
if
(
p_label
)
{
...
...
@@ -844,7 +852,7 @@ int
VCDOpen
(
vlc_object_t
*
p_this
)
{
access_t
*
p_access
=
(
access_t
*
)
p_this
;
vcdplayer_t
*
p_vcd
;
vcdplayer_t
*
p_vcd
player
;
char
*
psz_source
;
vcdinfo_itemid_t
itemid
;
vlc_bool_t
play_single_item
=
VLC_FALSE
;
...
...
@@ -861,15 +869,15 @@ VCDOpen ( vlc_object_t *p_this )
p_access
->
info
.
i_title
=
0
;
p_access
->
info
.
i_seekpoint
=
0
;
p_vcd
=
malloc
(
sizeof
(
vcdplayer_t
)
);
p_vcd
player
=
malloc
(
sizeof
(
vcdplayer_t
)
);
if
(
p_vcd
==
NULL
)
if
(
p_vcd
player
==
NULL
)
{
LOG_ERR
(
"out of memory"
);
return
VLC_ENOMEM
;
}
p_access
->
p_sys
=
(
access_sys_t
*
)
p_vcd
;
p_access
->
p_sys
=
(
access_sys_t
*
)
p_vcdplayer
;
/* Set where to log errors messages from libcdio. */
p_vcd_access
=
p_access
;
...
...
@@ -880,43 +888,45 @@ VCDOpen ( vlc_object_t *p_this )
if
(
NULL
==
psz_source
)
{
free
(
p_vcd
);
free
(
p_vcd
player
);
return
(
VLC_EGENERIC
);
}
dbg_print
(
(
INPUT_DBG_CALL
|
INPUT_DBG_EXT
),
"source: %s: mrl: %s"
,
psz_source
,
p_access
->
psz_path
);
p_vcd
->
psz_source
=
strdup
(
psz_source
);
p_vcd
->
i_debug
=
config_GetInt
(
p_this
,
p_vcd
player
->
psz_source
=
strdup
(
psz_source
);
p_vcd
player
->
i_debug
=
config_GetInt
(
p_this
,
MODULE_STRING
"-debug"
);
p_vcd
->
i_blocks_per_read
=
config_GetInt
(
p_this
,
MODULE_STRING
p_vcd
player
->
i_blocks_per_read
=
config_GetInt
(
p_this
,
MODULE_STRING
"-blocks-per-read"
);
p_vcd
->
in_still
=
VLC_FALSE
;
p_vcd
->
play_item
.
type
=
VCDINFO_ITEM_TYPE_NOTFOUND
;
p_vcd
->
p_input
=
vlc_object_find
(
p_access
,
VLC_OBJECT_INPUT
,
FIND_PARENT
);
p_vcd
->
p_demux
=
vlc_object_find
(
p_access
,
VLC_OBJECT_DEMUX
,
FIND_PARENT
);
p_vcd
->
p_meta
=
vlc_meta_New
();
p_vcd
->
p_segments
=
NULL
;
p_vcd
->
p_entries
=
NULL
;
p_vcdplayer
->
in_still
=
VLC_FALSE
;
p_vcdplayer
->
play_item
.
type
=
VCDINFO_ITEM_TYPE_NOTFOUND
;
p_vcdplayer
->
p_input
=
vlc_object_find
(
p_access
,
VLC_OBJECT_INPUT
,
FIND_PARENT
);
p_vcdplayer
->
p_demux
=
vlc_object_find
(
p_access
,
VLC_OBJECT_DEMUX
,
FIND_PARENT
);
p_vcdplayer
->
p_meta
=
vlc_meta_New
();
p_vcdplayer
->
p_segments
=
NULL
;
p_vcdplayer
->
p_entries
=
NULL
;
/* set up input */
if
(
!
(
p_vcd
->
vcd
=
vcd_Open
(
p_this
,
psz_source
))
)
if
(
!
(
p_vcd
player
->
vcd
=
vcd_Open
(
p_this
,
psz_source
))
)
{
msg_Warn
(
p_access
,
"could not open %s"
,
psz_source
);
goto
err_exit
;
}
p_vcd
->
b_svd
=
(
vlc_bool_t
)
vcdinfo_get_tracksSVD
(
p_vcd
->
vcd
);;
p_vcd
player
->
b_svd
=
(
vlc_bool_t
)
vcdinfo_get_tracksSVD
(
p_vcdplayer
->
vcd
);;
/* Get track information. */
p_vcd
->
i_tracks
=
vcdinfo_get_num_tracks
(
p_vcd
->
vcd
);
p_vcd
player
->
i_tracks
=
vcdinfo_get_num_tracks
(
p_vcdplayer
->
vcd
);
if
(
p_vcd
->
i_tracks
<
1
||
CDIO_INVALID_TRACK
==
p_vcd
->
i_tracks
)
{
vcdinfo_close
(
p_vcd
->
vcd
);
if
(
p_vcd
player
->
i_tracks
<
1
||
CDIO_INVALID_TRACK
==
p_vcdplayer
->
i_tracks
)
{
vcdinfo_close
(
p_vcd
player
->
vcd
);
LOG_ERR
(
"no movie tracks found"
);
goto
err_exit
;
}
...
...
@@ -928,7 +938,7 @@ VCDOpen ( vlc_object_t *p_this )
if
(
!
VCDEntryPoints
(
p_access
)
)
{
msg_Warn
(
p_access
,
"could not read entry points, will not use them"
);
p_vcd
->
b_valid_ep
=
VLC_FALSE
;
p_vcd
player
->
b_valid_ep
=
VLC_FALSE
;
}
/* Initialize LID info and add that as a menu item */
...
...
@@ -938,8 +948,9 @@ VCDOpen ( vlc_object_t *p_this )
}
/* Do we set PBC (via LID) on? */
p_vcd
->
i_lid
=
(
VCDINFO_ITEM_TYPE_LID
==
itemid
.
type
&&
p_vcd
->
i_lids
>
itemid
.
num
)
p_vcdplayer
->
i_lid
=
(
VCDINFO_ITEM_TYPE_LID
==
itemid
.
type
&&
p_vcdplayer
->
i_lids
>
itemid
.
num
)
?
itemid
.
num
:
VCDINFO_INVALID_ENTRY
;
...
...
@@ -956,12 +967,12 @@ VCDOpen ( vlc_object_t *p_this )
play_single_item
);
#endif
p_vcd
->
p_intf
=
intf_Create
(
p_access
,
"vcdx"
);
p_vcd
->
p_intf
->
b_block
=
VLC_FALSE
;
p_vcd
->
p_access
=
p_access
;
p_vcd
player
->
p_intf
=
intf_Create
(
p_access
,
"vcdx"
);
p_vcd
player
->
p_intf
->
b_block
=
VLC_FALSE
;
p_vcd
player
->
p_access
=
p_access
;
#ifdef FIXED
intf_RunThread
(
p_vcd
->
p_intf
);
intf_RunThread
(
p_vcd
player
->
p_intf
);
#endif
free
(
psz_source
);
...
...
@@ -969,7 +980,7 @@ VCDOpen ( vlc_object_t *p_this )
return
VLC_SUCCESS
;
err_exit:
free
(
psz_source
);
free
(
p_vcd
);
free
(
p_vcd
player
);
return
VLC_EGENERIC
;
}
...
...
@@ -980,20 +991,20 @@ void
VCDClose
(
vlc_object_t
*
p_this
)
{
access_t
*
p_access
=
(
access_t
*
)
p_this
;
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
dbg_print
(
(
INPUT_DBG_CALL
|
INPUT_DBG_EXT
),
"VCDClose"
);
vcdinfo_close
(
p_vcd
->
vcd
);
vcdinfo_close
(
p_vcd
player
->
vcd
);
FREE_AND_NULL
(
p_vcd
->
p_entries
);
FREE_AND_NULL
(
p_vcd
->
p_segments
);
FREE_AND_NULL
(
p_vcd
->
psz_source
);
FREE_AND_NULL
(
p_vcd
->
track
);
FREE_AND_NULL
(
p_vcd
->
segment
);
FREE_AND_NULL
(
p_vcd
->
entry
);
FREE_AND_NULL
(
p_vcd
player
->
p_entries
);
FREE_AND_NULL
(
p_vcd
player
->
p_segments
);
FREE_AND_NULL
(
p_vcd
player
->
psz_source
);
FREE_AND_NULL
(
p_vcd
player
->
track
);
FREE_AND_NULL
(
p_vcd
player
->
segment
);
FREE_AND_NULL
(
p_vcd
player
->
entry
);
free
(
p_vcd
);
free
(
p_vcd
player
);
p_access
->
p_sys
=
NULL
;
p_vcd_access
=
NULL
;
}
...
...
@@ -1005,7 +1016,7 @@ VCDClose ( vlc_object_t *p_this )
*****************************************************************************/
static
int
VCDControl
(
access_t
*
p_access
,
int
i_query
,
va_list
args
)
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
int
*
pi_int
;
int
i
;
...
...
@@ -1023,8 +1034,8 @@ static int VCDControl( access_t *p_access, int i_query, va_list args )
dbg_print
(
INPUT_DBG_EVENT
,
"get meta info"
);
if
(
p_vcd
->
p_meta
)
{
*
pp_meta
=
vlc_meta_Duplicate
(
p_vcd
->
p_meta
);
if
(
p_vcd
player
->
p_meta
)
{
*
pp_meta
=
vlc_meta_Duplicate
(
p_vcd
player
->
p_meta
);
dbg_print
(
INPUT_DBG_META
,
"%s"
,
"Meta copied"
);
}
else
msg_Warn
(
p_access
,
"tried to copy NULL meta info"
);
...
...
@@ -1050,7 +1061,7 @@ static int VCDControl( access_t *p_access, int i_query, va_list args )
/* */
case
ACCESS_GET_MTU
:
pi_int
=
(
int
*
)
va_arg
(
args
,
int
*
);
*
pi_int
=
(
p_vcd
->
i_blocks_per_read
*
M2F2_SECTOR_SIZE
);
*
pi_int
=
(
p_vcd
player
->
i_blocks_per_read
*
M2F2_SECTOR_SIZE
);
dbg_print
(
INPUT_DBG_EVENT
,
"GET MTU: %d"
,
*
pi_int
);
break
;
...
...
@@ -1073,7 +1084,7 @@ static int VCDControl( access_t *p_access, int i_query, va_list args )
case
ACCESS_GET_TITLE_INFO
:
{
unsigned
int
psz_mrl_max
=
strlen
(
VCD_MRL_PREFIX
)
+
strlen
(
p_vcd
->
psz_source
)
+
sizeof
(
"@E999"
)
+
3
;
+
strlen
(
p_vcd
player
->
psz_source
)
+
sizeof
(
"@E999"
)
+
3
;
input_title_t
***
ppp_title
=
(
input_title_t
***
)
va_arg
(
args
,
input_title_t
***
);
char
*
psz_mrl
=
malloc
(
psz_mrl_max
);
...
...
@@ -1082,33 +1093,34 @@ static int VCDControl( access_t *p_access, int i_query, va_list args )
pi_int
=
(
int
*
)
va_arg
(
args
,
int
*
);
dbg_print
(
INPUT_DBG_EVENT
,
"GET TITLE: i_titles %d"
,
p_vcd
->
i_titles
);
p_vcd
player
->
i_titles
);
if
(
psz_mrl
==
NULL
)
{
msg_Warn
(
p_access
,
"out of memory"
);
}
else
{
snprintf
(
psz_mrl
,
psz_mrl_max
,
"%s%s"
,
VCD_MRL_PREFIX
,
p_vcd
->
psz_source
);
VCD_MRL_PREFIX
,
p_vcd
player
->
psz_source
);
VCDMetaInfo
(
p_access
,
psz_mrl
);
free
(
psz_mrl
);
}
/* Duplicate title info */
if
(
p_vcd
->
i_titles
==
0
)
if
(
p_vcd
player
->
i_titles
==
0
)
{
*
pi_int
=
0
;
ppp_title
=
NULL
;
return
VLC_SUCCESS
;
}
*
pi_int
=
p_vcd
->
i_titles
;
*
ppp_title
=
malloc
(
sizeof
(
input_title_t
**
)
*
p_vcd
->
i_titles
);
*
pi_int
=
p_vcdplayer
->
i_titles
;
*
ppp_title
=
malloc
(
sizeof
(
input_title_t
**
)
*
p_vcdplayer
->
i_titles
);
if
(
!*
ppp_title
)
return
VLC_ENOMEM
;
for
(
i
=
0
;
i
<
p_vcd
->
i_titles
;
i
++
)
for
(
i
=
0
;
i
<
p_vcd
player
->
i_titles
;
i
++
)
{
if
(
p_vcd
->
p_title
[
i
]
)
if
(
p_vcd
player
->
p_title
[
i
]
)
(
*
ppp_title
)[
i
]
=
vlc_input_title_Duplicate
(
p_vcd
->
p_title
[
i
]
);
vlc_input_title_Duplicate
(
p_vcd
player
->
p_title
[
i
]
);
}
}
break
;
...
...
@@ -1122,7 +1134,7 @@ static int VCDControl( access_t *p_access, int i_query, va_list args )
vcdinfo_itemid_t
itemid
;
track_t
i_track
=
i
+
1
;
unsigned
int
i_entry
=
vcdinfo_track_get_entry
(
p_vcd
->
vcd
,
i_track
);
vcdinfo_track_get_entry
(
p_vcd
player
->
vcd
,
i_track
);
/* FIXME! For now we are assuming titles are only
tracks and that track == title+1 */
...
...
@@ -1130,14 +1142,14 @@ static int VCDControl( access_t *p_access, int i_query, va_list args )
itemid
.
type
=
VCDINFO_ITEM_TYPE_TRACK
;
VCDSetOrigin
(
p_access
,
vcdinfo_get_entry_lba
(
p_vcd
->
vcd
,
i_entry
),
vcdinfo_get_entry_lba
(
p_vcd
player
->
vcd
,
i_entry
),
i_track
,
&
itemid
);
}
break
;
case
ACCESS_SET_SEEKPOINT
:
{
input_title_t
*
t
=
p_vcd
->
p_title
[
p_access
->
info
.
i_title
];
input_title_t
*
t
=
p_vcd
player
->
p_title
[
p_access
->
info
.
i_title
];
unsigned
int
i
=
(
unsigned
int
)
va_arg
(
args
,
unsigned
int
);
dbg_print
(
INPUT_DBG_EVENT
,
"set seekpoint %d"
,
i
);
...
...
@@ -1152,27 +1164,28 @@ static int VCDControl( access_t *p_access, int i_query, va_list args )
We need to generalize all of this.
*/
if
(
i
<
p_vcd
->
i_entries
)
if
(
i
<
p_vcd
player
->
i_entries
)
{
p_vcd
->
play_item
.
num
=
i
;
p_vcd
->
play_item
.
type
=
VCDINFO_ITEM_TYPE_ENTRY
;
lsn
=
vcdinfo_get_entry_lba
(
p_vcd
->
vcd
,
i
);
}
else
if
(
i
<
p_vcd
->
i_entries
+
p_vcd
->
i_lids
)
p_vcd
player
->
play_item
.
num
=
i
;
p_vcd
player
->
play_item
.
type
=
VCDINFO_ITEM_TYPE_ENTRY
;
lsn
=
vcdinfo_get_entry_lba
(
p_vcd
player
->
vcd
,
i
);
}
else
if
(
i
<
p_vcd
player
->
i_entries
+
p_vcdplayer
->
i_lids
)
{
p_vcd
->
play_item
.
num
=
i
=
i
-
p_vcd
->
i_entries
;
p_vcd
->
play_item
.
type
=
VCDINFO_ITEM_TYPE_LID
;
p_vcdplayer
->
play_item
.
num
=
i
=
i
-
p_vcdplayer
->
i_entries
;
p_vcdplayer
->
play_item
.
type
=
VCDINFO_ITEM_TYPE_LID
;
lsn
=
0
;
}
else
{
p_vcd
->
play_item
.
num
=
i
=
i
-
p_vcd
->
i_entries
-
p_vcd
->
i_lids
;
p_vcd
->
play_item
.
type
=
VCDINFO_ITEM_TYPE_SEGMENT
;
lsn
=
vcdinfo_get_seg_lsn
(
p_vcd
->
vcd
,
i
);
p_vcd
player
->
play_item
.
num
=
i
=
i
-
p_vcdplayer
->
i_entries
-
p_vcdplayer
->
i_lids
;
p_vcd
player
->
play_item
.
type
=
VCDINFO_ITEM_TYPE_SEGMENT
;
lsn
=
vcdinfo_get_seg_lsn
(
p_vcd
player
->
vcd
,
i
);
}
VCDSetOrigin
(
p_access
,
vcdinfo_get_entry_lba
(
p_vcd
->
vcd
,
i
),
i_track
,
&
(
p_vcd
->
play_item
)
);
vcdinfo_get_entry_lba
(
p_vcd
player
->
vcd
,
i
),
i_track
,
&
(
p_vcd
player
->
play_item
)
);
}
return
VLC_SUCCESS
;
}
...
...
modules/access/vcdx/info.c
View file @
79053042
...
...
@@ -40,10 +40,11 @@ static inline void
MetaInfoAddStr
(
access_t
*
p_access
,
char
*
psz_cat
,
char
*
title
,
const
char
*
psz
)
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
if
(
psz
)
{
dbg_print
(
INPUT_DBG_META
,
"cat %s, field: %s: %s"
,
psz_cat
,
title
,
psz
);
input_Control
(
p_vcd
->
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
title
,
"%s"
,
psz
);
input_Control
(
p_vcdplayer
->
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
title
,
"%s"
,
psz
);
}
}
...
...
@@ -51,17 +52,19 @@ MetaInfoAddStr(access_t *p_access, char *psz_cat,
static
inline
void
MetaInfoAddNum
(
access_t
*
p_access
,
char
*
psz_cat
,
char
*
title
,
int
num
)
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
dbg_print
(
INPUT_DBG_META
,
"cat %s, field %s: %d"
,
psz_cat
,
title
,
num
);
input_Control
(
p_vcd
->
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
title
,
"%d"
,
num
);
input_Control
(
p_vcdplayer
->
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
title
,
"%d"
,
num
);
}
static
inline
void
MetaInfoAddHex
(
access_t
*
p_access
,
char
*
psz_cat
,
char
*
title
,
int
hex
)
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
dbg_print
(
INPUT_DBG_META
,
"cat %s, field %s: %d"
,
psz_cat
,
title
,
hex
);
input_Control
(
p_vcd
->
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
title
,
"%x"
,
hex
);
input_Control
(
p_vcdplayer
->
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
title
,
"%x"
,
hex
);
}
#define addstr(title, str) \
...
...
@@ -76,47 +79,47 @@ MetaInfoAddHex(access_t *p_access, char *psz_cat, char *title, int hex)
void
VCDMetaInfo
(
access_t
*
p_access
,
/*const*/
char
*
psz_mrl
)
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
unsigned
int
i_entries
=
vcdinfo_get_num_entries
(
p_vcd
->
vcd
);
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
unsigned
int
i_entries
=
vcdinfo_get_num_entries
(
p_vcd
player
->
vcd
);
unsigned
int
last_entry
=
0
;
char
*
psz_cat
;
track_t
i_track
;
psz_cat
=
_
(
"Disc"
);
addstr
(
_
(
"VCD Format"
),
vcdinfo_get_format_version_str
(
p_vcd
->
vcd
)
);
addstr
(
_
(
"Album"
),
vcdinfo_get_album_id
(
p_vcd
->
vcd
));
addstr
(
_
(
"Application"
),
vcdinfo_get_application_id
(
p_vcd
->
vcd
)
);
addstr
(
_
(
"Preparer"
),
vcdinfo_get_preparer_id
(
p_vcd
->
vcd
)
);
addnum
(
_
(
"Vol #"
),
vcdinfo_get_volume_num
(
p_vcd
->
vcd
)
);
addnum
(
_
(
"Vol max #"
),
vcdinfo_get_volume_count
(
p_vcd
->
vcd
)
);
addstr
(
_
(
"Volume Set"
),
vcdinfo_get_volumeset_id
(
p_vcd
->
vcd
)
);
addstr
(
_
(
"Volume"
),
vcdinfo_get_volume_id
(
p_vcd
->
vcd
)
);
addstr
(
_
(
"Publisher"
),
vcdinfo_get_publisher_id
(
p_vcd
->
vcd
)
);
addstr
(
_
(
"System Id"
),
vcdinfo_get_system_id
(
p_vcd
->
vcd
)
);
addnum
(
"LIDs"
,
vcdinfo_get_num_LIDs
(
p_vcd
->
vcd
)
);
addnum
(
_
(
"Entries"
),
vcdinfo_get_num_entries
(
p_vcd
->
vcd
)
);
addnum
(
_
(
"Segments"
),
vcdinfo_get_num_segments
(
p_vcd
->
vcd
)
);
addnum
(
_
(
"Tracks"
),
vcdinfo_get_num_tracks
(
p_vcd
->
vcd
)
);
addstr
(
_
(
"VCD Format"
),
vcdinfo_get_format_version_str
(
p_vcd
player
->
vcd
)
);
addstr
(
_
(
"Album"
),
vcdinfo_get_album_id
(
p_vcd
player
->
vcd
));
addstr
(
_
(
"Application"
),
vcdinfo_get_application_id
(
p_vcd
player
->
vcd
)
);
addstr
(
_
(
"Preparer"
),
vcdinfo_get_preparer_id
(
p_vcd
player
->
vcd
)
);
addnum
(
_
(
"Vol #"
),
vcdinfo_get_volume_num
(
p_vcd
player
->
vcd
)
);
addnum
(
_
(
"Vol max #"
),
vcdinfo_get_volume_count
(
p_vcd
player
->
vcd
)
);
addstr
(
_
(
"Volume Set"
),
vcdinfo_get_volumeset_id
(
p_vcd
player
->
vcd
)
);
addstr
(
_
(
"Volume"
),
vcdinfo_get_volume_id
(
p_vcd
player
->
vcd
)
);
addstr
(
_
(
"Publisher"
),
vcdinfo_get_publisher_id
(
p_vcd
player
->
vcd
)
);
addstr
(
_
(
"System Id"
),
vcdinfo_get_system_id
(
p_vcd
player
->
vcd
)
);
addnum
(
"LIDs"
,
vcdinfo_get_num_LIDs
(
p_vcd
player
->
vcd
)
);
addnum
(
_
(
"Entries"
),
vcdinfo_get_num_entries
(
p_vcd
player
->
vcd
)
);
addnum
(
_
(
"Segments"
),
vcdinfo_get_num_segments
(
p_vcd
player
->
vcd
)
);
addnum
(
_
(
"Tracks"
),
vcdinfo_get_num_tracks
(
p_vcd
player
->
vcd
)
);
/* Spit out track information. Could also include MSF info.
Also build title table.
*/
#define TITLE_MAX 30
for
(
i_track
=
1
;
i_track
<
p_vcd
->
i_tracks
;
i_track
++
)
{
unsigned
int
audio_type
=
vcdinfo_get_track_audio_type
(
p_vcd
->
vcd
,
for
(
i_track
=
1
;
i_track
<
p_vcd
player
->
i_tracks
;
i_track
++
)
{
unsigned
int
audio_type
=
vcdinfo_get_track_audio_type
(
p_vcd
player
->
vcd
,
i_track
);
uint32_t
i_secsize
=
vcdinfo_get_track_sect_count
(
p_vcd
->
vcd
,
i_track
);
uint32_t
i_secsize
=
vcdinfo_get_track_sect_count
(
p_vcd
player
->
vcd
,
i_track
);
if
(
p_vcd
->
b_svd
)
{
if
(
p_vcd
player
->
b_svd
)
{
addnum
(
_
(
"Audio Channels"
),
vcdinfo_audio_type_num_channels
(
p_vcd
->
vcd
,
audio_type
)
);
vcdinfo_audio_type_num_channels
(
p_vcd
player
->
vcd
,
audio_type
)
);
}
addnum
(
_
(
"First Entry Point"
),
last_entry
);
for
(
;
last_entry
<
i_entries
&&
vcdinfo_get_track
(
p_vcd
->
vcd
,
last_entry
)
==
i_track
;
&&
vcdinfo_get_track
(
p_vcd
player
->
vcd
,
last_entry
)
==
i_track
;
last_entry
++
)
;
addnum
(
_
(
"Last Entry Point"
),
last_entry
-
1
);
addnum
(
_
(
"Track size (in sectors)"
),
i_secsize
);
...
...
@@ -124,11 +127,11 @@ VCDMetaInfo( access_t *p_access, /*const*/ char *psz_mrl )
{
lid_t
i_lid
;
for
(
i_lid
=
1
;
i_lid
<=
p_vcd
->
i_lids
;
i_lid
++
)
{
for
(
i_lid
=
1
;
i_lid
<=
p_vcd
player
->
i_lids
;
i_lid
++
)
{
PsdListDescriptor_t
pxd
;
char
psz_cat
[
20
];
snprintf
(
psz_cat
,
sizeof
(
psz_cat
),
"LID %d"
,
i_lid
);
if
(
vcdinfo_lid_get_pxd
(
p_vcd
->
vcd
,
&
pxd
,
i_lid
))
{
if
(
vcdinfo_lid_get_pxd
(
p_vcd
player
->
vcd
,
&
pxd
,
i_lid
))
{
switch
(
pxd
.
descriptor_type
)
{
case
PSD_TYPE_END_LIST
:
addstr
(
_
(
"type"
),
_
(
"end"
));
...
...
@@ -168,11 +171,11 @@ VCDMetaInfo( access_t *p_access, /*const*/ char *psz_mrl )
if
(
CDIO_INVALID_TRACK
!=
i_track
)
{
char
*
psz_name
=
VCDFormatStr
(
p_access
,
p_vcd
,
VCDFormatStr
(
p_access
,
p_vcd
player
,
config_GetPsz
(
p_access
,
MODULE_STRING
"-title-format"
),
psz_mrl
,
&
(
p_vcd
->
play_item
)
);
psz_mrl
,
&
(
p_vcd
player
->
play_item
)
);
input_Control
(
p_vcd
->
p_input
,
INPUT_SET_NAME
,
psz_name
);
input_Control
(
p_vcd
player
->
p_input
,
INPUT_SET_NAME
,
psz_name
);
}
}
...
...
@@ -228,7 +231,7 @@ VCDMetaInfo( access_t *p_access, /*const*/ char *psz_mrl )
%% : a %
*/
char
*
VCDFormatStr
(
const
access_t
*
p_access
,
vcdplayer_t
*
p_vcd
,
VCDFormatStr
(
const
access_t
*
p_access
,
vcdplayer_t
*
p_vcd
player
,
const
char
format_str
[],
const
char
*
mrl
,
const
vcdinfo_itemid_t
*
itemid
)
{
...
...
@@ -258,20 +261,20 @@ VCDFormatStr(const access_t *p_access, vcdplayer_t *p_vcd,
saw_control_prefix
=
!
saw_control_prefix
;
break
;
case
'A'
:
add_format_str_info
(
vcdinfo_strip_trail
(
vcdinfo_get_album_id
(
p_vcd
->
vcd
),
add_format_str_info
(
vcdinfo_strip_trail
(
vcdinfo_get_album_id
(
p_vcd
player
->
vcd
),
MAX_ALBUM_LEN
));
break
;
case
'c'
:
add_format_num_info
(
vcdinfo_get_volume_num
(
p_vcd
->
vcd
),
"%d"
);
add_format_num_info
(
vcdinfo_get_volume_num
(
p_vcd
player
->
vcd
),
"%d"
);
break
;
case
'C'
:
add_format_num_info
(
vcdinfo_get_volume_count
(
p_vcd
->
vcd
),
"%d"
);
add_format_num_info
(
vcdinfo_get_volume_count
(
p_vcd
player
->
vcd
),
"%d"
);
break
;
case
'F'
:
add_format_str_info
(
vcdinfo_get_format_version_str
(
p_vcd
->
vcd
));
add_format_str_info
(
vcdinfo_get_format_version_str
(
p_vcd
player
->
vcd
));
break
;
case
'I'
:
...
...
@@ -306,9 +309,9 @@ VCDFormatStr(const access_t *p_access, vcdplayer_t *p_vcd,
break
;
case
'L'
:
if
(
vcdplayer_pbc_is_on
(
p_vcd
))
{
if
(
vcdplayer_pbc_is_on
(
p_vcd
player
))
{
char
num_str
[
40
];
sprintf
(
num_str
,
"%s %d"
,
_
(
"List ID"
),
p_vcd
->
i_lid
);
sprintf
(
num_str
,
"%s %d"
,
_
(
"List ID"
),
p_vcd
player
->
i_lid
);
strncat
(
tp
,
num_str
,
TEMP_STR_LEN
-
(
tp
-
temp_str
));
tp
+=
strlen
(
num_str
);
}
...
...
@@ -324,11 +327,11 @@ VCDFormatStr(const access_t *p_access, vcdplayer_t *p_vcd,
break
;
case
'p'
:
add_format_str_info
(
vcdinfo_get_preparer_id
(
p_vcd
->
vcd
));
add_format_str_info
(
vcdinfo_get_preparer_id
(
p_vcd
player
->
vcd
));
break
;
case
'P'
:
add_format_str_info
(
vcdinfo_get_publisher_id
(
p_vcd
->
vcd
));
add_format_str_info
(
vcdinfo_get_publisher_id
(
p_vcd
player
->
vcd
));
break
;
case
'S'
:
...
...
@@ -336,7 +339,7 @@ VCDFormatStr(const access_t *p_access, vcdplayer_t *p_vcd,
char
seg_type_str
[
10
];
sprintf
(
seg_type_str
,
" %s"
,
vcdinfo_video_type2str
(
p_vcd
->
vcd
,
itemid
->
num
));
vcdinfo_video_type2str
(
p_vcd
player
->
vcd
,
itemid
->
num
));
strncat
(
tp
,
seg_type_str
,
TEMP_STR_LEN
-
(
tp
-
temp_str
));
tp
+=
strlen
(
seg_type_str
);
}
...
...
@@ -344,15 +347,15 @@ VCDFormatStr(const access_t *p_access, vcdplayer_t *p_vcd,
break
;
case
'T'
:
add_format_num_info
(
p_vcd
->
i_track
,
"%d"
);
add_format_num_info
(
p_vcd
player
->
i_track
,
"%d"
);
break
;
case
'V'
:
add_format_str_info
(
vcdinfo_get_volumeset_id
(
p_vcd
->
vcd
));
add_format_str_info
(
vcdinfo_get_volumeset_id
(
p_vcd
player
->
vcd
));
break
;
case
'v'
:
add_format_str_info
(
vcdinfo_get_volume_id
(
p_vcd
->
vcd
));
add_format_str_info
(
vcdinfo_get_volume_id
(
p_vcd
player
->
vcd
));
break
;
default:
...
...
@@ -368,22 +371,22 @@ void
VCDUpdateTitle
(
access_t
*
p_access
)
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
unsigned
int
psz_mrl_max
=
strlen
(
VCD_MRL_PREFIX
)
+
strlen
(
p_vcd
->
psz_source
)
+
sizeof
(
"@E999"
)
+
3
;
+
strlen
(
p_vcd
player
->
psz_source
)
+
sizeof
(
"@E999"
)
+
3
;
char
*
psz_mrl
=
malloc
(
psz_mrl_max
);
if
(
psz_mrl
)
{
char
*
psz_name
;
snprintf
(
psz_mrl
,
psz_mrl_max
,
"%s%s"
,
VCD_MRL_PREFIX
,
p_vcd
->
psz_source
);
psz_name
=
VCDFormatStr
(
p_access
,
p_vcd
,
VCD_MRL_PREFIX
,
p_vcd
player
->
psz_source
);
psz_name
=
VCDFormatStr
(
p_access
,
p_vcd
player
,
config_GetPsz
(
p_access
,
MODULE_STRING
"-title-format"
),
psz_mrl
,
&
(
p_vcd
->
play_item
)
);
input_Control
(
p_vcd
->
p_input
,
INPUT_SET_NAME
,
psz_name
);
psz_mrl
,
&
(
p_vcd
player
->
play_item
)
);
input_Control
(
p_vcd
player
->
p_input
,
INPUT_SET_NAME
,
psz_name
);
free
(
psz_mrl
);
}
}
...
...
modules/access/vcdx/info.h
View file @
79053042
...
...
@@ -32,7 +32,7 @@
void
VCDMetaInfo
(
access_t
*
p_access
,
/*const*/
char
*
psz_mrl
);
char
*
VCDFormatStr
(
const
access_t
*
p_access
,
vcdplayer_t
*
p_vcd
,
char
*
VCDFormatStr
(
const
access_t
*
p_access
,
vcdplayer_t
*
p_vcd
player
,
const
char
format_str
[],
const
char
*
mrl
,
const
vcdinfo_itemid_t
*
itemid
);
...
...
modules/access/vcdx/intf.c
View file @
79053042
...
...
@@ -93,7 +93,7 @@ RunIntf( intf_thread_t *p_intf )
vlc_object_t
*
p_vout
=
NULL
;
mtime_t
mtime
=
0
;
mtime_t
mlast
=
0
;
vcdplayer_t
*
p_vcd
;
vcdplayer_t
*
p_vcd
player
;
input_thread_t
*
p_input
;
access_t
*
p_access
;
...
...
@@ -109,13 +109,13 @@ RunIntf( intf_thread_t *p_intf )
p_input
=
p_intf
->
p_sys
->
p_input
;
while
(
!
p_intf
->
p_sys
->
p_vcd
)
while
(
!
p_intf
->
p_sys
->
p_vcd
player
)
{
msleep
(
INTF_IDLE_SLEEP
);
}
p_vcd
=
p_intf
->
p_sys
->
p_vcd
;
p_access
=
p_vcd
->
p_access
;
p_vcd
player
=
p_intf
->
p_sys
->
p_vcdplayer
;
p_access
=
p_vcdplayer
->
p_access
;
dbg_print
(
INPUT_DBG_CALL
,
"intf initialized"
);
...
...
@@ -210,13 +210,14 @@ RunIntf( intf_thread_t *p_intf )
case
ACTIONID_NAV_ACTIVATE
:
{
vcdinfo_itemid_t
itemid
;
itemid
.
type
=
p_vcd
->
play_item
.
type
;
itemid
.
type
=
p_vcd
player
->
play_item
.
type
;
dbg_print
(
INPUT_DBG_EVENT
,
"ACTIONID_NAV_ACTIVATE"
);
if
(
vcdplayer_pbc_is_on
(
p_vcd
)
&&
number_addend
!=
0
)
{
lid_t
next_num
=
vcdinfo_selection_get_lid
(
p_vcd
->
vcd
,
p_vcd
->
i_lid
,
if
(
vcdplayer_pbc_is_on
(
p_vcdplayer
)
&&
number_addend
!=
0
)
{
lid_t
next_num
=
vcdinfo_selection_get_lid
(
p_vcdplayer
->
vcd
,
p_vcdplayer
->
i_lid
,
number_addend
);
if
(
VCDINFO_INVALID_LID
!=
next_num
)
{
itemid
.
num
=
next_num
;
...
...
@@ -326,8 +327,8 @@ static int InitThread( intf_thread_t * p_intf )
vlc_mutex_lock
(
&
p_intf
->
change_lock
);
p_intf
->
p_sys
->
p_input
=
p_input
;
p_intf
->
p_sys
->
p_vcd
=
NULL
;
p_intf
->
p_sys
->
p_input
=
p_input
;
p_intf
->
p_sys
->
p_vcd
player
=
NULL
;
p_intf
->
p_sys
->
b_move
=
VLC_FALSE
;
p_intf
->
p_sys
->
b_click
=
VLC_FALSE
;
...
...
modules/access/vcdx/intf.h
View file @
79053042
...
...
@@ -27,7 +27,7 @@
struct
intf_sys_t
{
input_thread_t
*
p_input
;
vcdplayer_t
*
p_vcd
;
vcdplayer_t
*
p_vcd
player
;
vlc_bool_t
b_still
;
/* True if we are in a still frame */
vlc_bool_t
b_infinite_still
;
/* True if still wait time is infinite */
...
...
modules/access/vcdx/vcdplayer.c
View file @
79053042
...
...
@@ -54,9 +54,9 @@ extern void VCDSetOrigin ( access_t *p_access, lsn_t i_lsn, track_t i_track,
Return true if playback control (PBC) is on
*/
bool
vcdplayer_pbc_is_on
(
const
vcdplayer_t
*
p_vcd
)
vcdplayer_pbc_is_on
(
const
vcdplayer_t
*
p_vcd
player
)
{
return
VCDINFO_INVALID_ENTRY
!=
p_vcd
->
i_lid
;
return
VCDINFO_INVALID_ENTRY
!=
p_vcd
player
->
i_lid
;
}
/* Given an itemid, return the size for the object (via information
...
...
@@ -64,17 +64,17 @@ vcdplayer_pbc_is_on( const vcdplayer_t *p_vcd )
static
size_t
vcdplayer_get_item_size
(
access_t
*
p_access
,
vcdinfo_itemid_t
itemid
)
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
switch
(
itemid
.
type
)
{
case
VCDINFO_ITEM_TYPE_ENTRY
:
return
p_vcd
->
entry
[
itemid
.
num
].
size
;
return
p_vcd
player
->
entry
[
itemid
.
num
].
size
;
break
;
case
VCDINFO_ITEM_TYPE_SEGMENT
:
return
p_vcd
->
segment
[
itemid
.
num
].
size
;
return
p_vcd
player
->
segment
[
itemid
.
num
].
size
;
break
;
case
VCDINFO_ITEM_TYPE_TRACK
:
return
p_vcd
->
track
[
itemid
.
num
-
1
].
size
;
return
p_vcd
player
->
track
[
itemid
.
num
-
1
].
size
;
break
;
case
VCDINFO_ITEM_TYPE_LID
:
/* Play list number (LID) */
...
...
@@ -92,12 +92,12 @@ static void
vcdplayer_update_entry
(
access_t
*
p_access
,
uint16_t
ofs
,
uint16_t
*
entry
,
const
char
*
label
)
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
if
(
ofs
==
VCDINFO_INVALID_OFFSET
)
{
*
entry
=
VCDINFO_INVALID_ENTRY
;
}
else
{
vcdinfo_offset_t
*
off
=
vcdinfo_get_offset_t
(
p_vcd
->
vcd
,
ofs
);
vcdinfo_offset_t
*
off
=
vcdinfo_get_offset_t
(
p_vcd
player
->
vcd
,
ofs
);
if
(
off
!=
NULL
)
{
*
entry
=
off
->
lid
;
dbg_print
(
INPUT_DBG_PBC
,
"%s: LID %d"
,
label
,
off
->
lid
);
...
...
@@ -116,10 +116,10 @@ vcdplayer_update_entry( access_t * p_access, uint16_t ofs,
vcdplayer_read_status_t
vcdplayer_non_pbc_nav
(
access_t
*
p_access
,
uint8_t
*
wait_time
)
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
/* Not in playback control. Do we advance automatically or stop? */
switch
(
p_vcd
->
play_item
.
type
)
{
switch
(
p_vcd
player
->
play_item
.
type
)
{
case
VCDINFO_ITEM_TYPE_TRACK
:
case
VCDINFO_ITEM_TYPE_ENTRY
:
{
if
(
!
vcdplayer_play_next
(
p_access
)
)
...
...
@@ -131,7 +131,7 @@ vcdplayer_non_pbc_nav ( access_t *p_access, uint8_t *wait_time )
case
VCDINFO_ITEM_TYPE_SPAREID2
:
dbg_print
(
(
INPUT_DBG_STILL
|
INPUT_DBG_LSN
),
"SPAREID2"
);
if
(
p_vcd
->
in_still
)
if
(
p_vcd
player
->
in_still
)
{
dbg_print
(
(
INPUT_DBG_STILL
|
INPUT_DBG_LSN
),
"End of still spareid2"
);
...
...
@@ -148,7 +148,7 @@ vcdplayer_non_pbc_nav ( access_t *p_access, uint8_t *wait_time )
case
VCDINFO_ITEM_TYPE_SEGMENT
:
/* Hack: Just go back and do still again */
/* FIXME */
if
(
p_vcd
->
in_still
)
if
(
p_vcd
player
->
in_still
)
{
dbg_print
(
(
INPUT_DBG_STILL
|
INPUT_DBG_LSN
),
"End of still Segment"
);
...
...
@@ -166,21 +166,21 @@ vcdplayer_non_pbc_nav ( access_t *p_access, uint8_t *wait_time )
static
void
_vcdplayer_set_track
(
access_t
*
p_access
,
track_t
i_track
)
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
if
(
i_track
<
1
||
i_track
>
p_vcd
->
i_tracks
)
vcdplayer_t
*
p_vcdplayer
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
if
(
i_track
<
1
||
i_track
>
p_vcd
player
->
i_tracks
)
return
;
else
{
vcdinfo_obj_t
*
p_obj
=
p_vcd
->
vcd
;
vcdinfo_obj_t
*
p_obj
=
p_vcd
player
->
vcd
;
vcdinfo_itemid_t
itemid
;
itemid
.
num
=
i_track
;
itemid
.
type
=
VCDINFO_ITEM_TYPE_TRACK
;
p_vcd
->
in_still
=
0
;
itemid
.
num
=
i_track
;
itemid
.
type
=
VCDINFO_ITEM_TYPE_TRACK
;
p_vcd
player
->
in_still
=
0
;
VCDSetOrigin
(
p_access
,
vcdinfo_get_track_lsn
(
p_obj
,
i_track
),
i_track
,
&
itemid
);
dbg_print
(
INPUT_DBG_LSN
,
"LSN: %u"
,
p_vcd
->
i_lsn
);
dbg_print
(
INPUT_DBG_LSN
,
"LSN: %u"
,
p_vcd
player
->
i_lsn
);
}
}
...
...
@@ -190,9 +190,9 @@ _vcdplayer_set_track(access_t * p_access, track_t i_track)
static
void
_vcdplayer_set_entry
(
access_t
*
p_access
,
unsigned
int
num
)
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdinfo_obj_t
*
p_
obj
=
p_vcd
->
vcd
;
unsigned
int
num_entries
=
vcdinfo_get_num_entries
(
p_
obj
);
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdinfo_obj_t
*
p_
vcdinfo
=
p_vcdplayer
->
vcd
;
unsigned
int
num_entries
=
vcdinfo_get_num_entries
(
p_
vcdinfo
);
if
(
num
>=
num_entries
)
{
LOG_ERR
(
"%s %d"
,
_
(
"bad entry number"
),
num
);
...
...
@@ -200,15 +200,15 @@ _vcdplayer_set_entry(access_t * p_access, unsigned int num)
}
else
{
vcdinfo_itemid_t
itemid
;
itemid
.
num
=
num
;
itemid
.
type
=
VCDINFO_ITEM_TYPE_ENTRY
;
p_vcd
->
in_still
=
0
;
itemid
.
num
=
num
;
itemid
.
type
=
VCDINFO_ITEM_TYPE_ENTRY
;
p_vcd
player
->
in_still
=
0
;
VCDSetOrigin
(
p_access
,
vcdinfo_get_entry_lba
(
p_
obj
,
num
),
vcdinfo_get_track
(
p_
obj
,
num
),
&
itemid
);
VCDSetOrigin
(
p_access
,
vcdinfo_get_entry_lba
(
p_
vcdinfo
,
num
),
vcdinfo_get_track
(
p_
vcdinfo
,
num
),
&
itemid
);
dbg_print
(
INPUT_DBG_LSN
,
"LSN: %u, track_end LSN: %u"
,
p_vcd
->
i_lsn
,
p_vcd
->
track_end_lsn
);
p_vcd
player
->
i_lsn
,
p_vcdplayer
->
track_end_lsn
);
}
}
...
...
@@ -218,17 +218,17 @@ _vcdplayer_set_entry(access_t * p_access, unsigned int num)
static
void
_vcdplayer_set_segment
(
access_t
*
p_access
,
unsigned
int
num
)
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdinfo_obj_t
*
p_
obj
=
p_vcd
->
vcd
;
segnum_t
num_segs
=
vcdinfo_get_num_segments
(
p_obj
);
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdinfo_obj_t
*
p_
vcdinfo
=
p_vcdplayer
->
vcd
;
segnum_t
i_segs
=
vcdinfo_get_num_segments
(
p_vcdinfo
);
if
(
num
>=
num
_segs
)
{
if
(
num
>=
i
_segs
)
{
LOG_ERR
(
"%s %d"
,
_
(
"bad segment number"
),
num
);
return
;
}
else
{
vcdinfo_itemid_t
itemid
;
if
(
VCDINFO_NULL_LSN
==
p_vcd
->
i_lsn
)
{
if
(
VCDINFO_NULL_LSN
==
p_vcd
player
->
i_lsn
)
{
LOG_ERR
(
"%s %d"
,
_
(
"Error in getting current segment number"
),
num
);
return
;
...
...
@@ -237,9 +237,9 @@ _vcdplayer_set_segment(access_t * p_access, unsigned int num)
itemid
.
num
=
num
;
itemid
.
type
=
VCDINFO_ITEM_TYPE_SEGMENT
;
VCDSetOrigin
(
p_access
,
vcdinfo_get_seg_lsn
(
p_
obj
,
num
),
0
,
&
itemid
);
VCDSetOrigin
(
p_access
,
vcdinfo_get_seg_lsn
(
p_
vcdinfo
,
num
),
0
,
&
itemid
);
dbg_print
(
INPUT_DBG_LSN
,
"LSN: %u"
,
p_vcd
->
i_lsn
);
dbg_print
(
INPUT_DBG_LSN
,
"LSN: %u"
,
p_vcd
player
->
i_lsn
);
}
}
...
...
@@ -248,26 +248,26 @@ _vcdplayer_set_segment(access_t * p_access, unsigned int num)
static
bool
vcdplayer_play_single_item
(
access_t
*
p_access
,
vcdinfo_itemid_t
itemid
)
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdinfo_obj_t
*
p_
obj
=
p_vcd
->
vcd
;
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdinfo_obj_t
*
p_
vcdinfo
=
p_vcdplayer
->
vcd
;
dbg_print
(
INPUT_DBG_CALL
,
"called itemid.num: %d, itemid.type: %d"
,
itemid
.
num
,
itemid
.
type
);
p_vcd
->
in_still
=
0
;
p_vcd
player
->
in_still
=
0
;
switch
(
itemid
.
type
)
{
case
VCDINFO_ITEM_TYPE_SEGMENT
:
{
vcdinfo_video_segment_type_t
segtype
=
vcdinfo_get_video_type
(
p_
obj
,
itemid
.
num
);
segnum_t
num_segs
=
vcdinfo_get_num_segments
(
p_obj
);
=
vcdinfo_get_video_type
(
p_
vcdinfo
,
itemid
.
num
);
segnum_t
i_segs
=
vcdinfo_get_num_segments
(
p_vcdinfo
);
dbg_print
(
INPUT_DBG_PBC
,
"%s (%d), itemid.num: %d"
,
vcdinfo_video_type2str
(
p_
obj
,
itemid
.
num
),
vcdinfo_video_type2str
(
p_
vcdinfo
,
itemid
.
num
),
(
int
)
segtype
,
itemid
.
num
);
if
(
itemid
.
num
>=
num
_segs
)
return
false
;
if
(
itemid
.
num
>=
i
_segs
)
return
false
;
_vcdplayer_set_segment
(
p_access
,
itemid
.
num
);
switch
(
segtype
)
...
...
@@ -276,10 +276,10 @@ vcdplayer_play_single_item( access_t * p_access, vcdinfo_itemid_t itemid)
case
VCDINFO_FILES_VIDEO_NTSC_STILL2
:
case
VCDINFO_FILES_VIDEO_PAL_STILL
:
case
VCDINFO_FILES_VIDEO_PAL_STILL2
:
p_vcd
->
in_still
=
-
5
;
p_vcd
player
->
in_still
=
-
5
;
break
;
default:
p_vcd
->
in_still
=
0
;
p_vcd
player
->
in_still
=
0
;
}
break
;
...
...
@@ -287,13 +287,13 @@ vcdplayer_play_single_item( access_t * p_access, vcdinfo_itemid_t itemid)
case
VCDINFO_ITEM_TYPE_TRACK
:
dbg_print
(
INPUT_DBG_PBC
,
"track %d"
,
itemid
.
num
);
if
(
itemid
.
num
<
1
||
itemid
.
num
>
p_vcd
->
i_tracks
)
return
false
;
if
(
itemid
.
num
<
1
||
itemid
.
num
>
p_vcd
player
->
i_tracks
)
return
false
;
_vcdplayer_set_track
(
p_access
,
itemid
.
num
);
break
;
case
VCDINFO_ITEM_TYPE_ENTRY
:
{
unsigned
int
num_entries
=
vcdinfo_get_num_entries
(
p_
obj
);
unsigned
int
num_entries
=
vcdinfo_get_num_entries
(
p_
vcdinfo
);
dbg_print
(
INPUT_DBG_PBC
,
"entry %d"
,
itemid
.
num
);
if
(
itemid
.
num
>=
num_entries
)
return
false
;
_vcdplayer_set_entry
(
p_access
,
itemid
.
num
);
...
...
@@ -301,13 +301,13 @@ vcdplayer_play_single_item( access_t * p_access, vcdinfo_itemid_t itemid)
}
case
VCDINFO_ITEM_TYPE_LID
:
LOG_ERR
(
"%s"
,
_
(
"Should have converted p_vcd above"
));
LOG_ERR
(
"%s"
,
_
(
"Should have converted p_vcd
player
above"
));
return
false
;
break
;
case
VCDINFO_ITEM_TYPE_NOTFOUND
:
dbg_print
(
INPUT_DBG_PBC
,
"play nothing"
);
p_vcd
->
i_lsn
=
p_vcd
->
end_lsn
;
p_vcd
player
->
i_lsn
=
p_vcdplayer
->
end_lsn
;
return
false
;
default:
...
...
@@ -315,19 +315,19 @@ vcdplayer_play_single_item( access_t * p_access, vcdinfo_itemid_t itemid)
return
false
;
}
p_vcd
->
play_item
=
itemid
;
p_vcd
player
->
play_item
=
itemid
;
/* Some players like xine, have a fifo queue of audio and video buffers
that need to be flushed when playing a new selection. */
/* if (p_vcd->flush_buffers)
p_vcd->flush_buffers(); */
/* if (p_vcd
player
->flush_buffers)
p_vcd
player
->flush_buffers(); */
return
true
;
}
/*
Set's start origin and size for subsequent seeks.
input: p_vcd
->i_lsn, p_vcd
->play_item
changed: p_vcd
->origin_lsn, p_vcd
->end_lsn
input: p_vcd
player->i_lsn, p_vcdplayer
->play_item
changed: p_vcd
player->origin_lsn, p_vcdplayer
->end_lsn
*/
/* FIXME: add parameters lsn, i_track, p_itemid and set accordingly. */
...
...
@@ -335,59 +335,60 @@ void
vcdplayer_set_origin
(
access_t
*
p_access
,
lsn_t
i_lsn
,
track_t
i_track
,
const
vcdinfo_itemid_t
*
p_itemid
)
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
const
size_t
i_size
=
vcdplayer_get_item_size
(
p_access
,
*
p_itemid
);
p_vcd
->
play_item
.
num
=
p_itemid
->
num
;
p_vcd
->
play_item
.
type
=
p_itemid
->
type
;
p_vcd
->
i_lsn
=
i_lsn
;
p_vcd
->
end_lsn
=
p_vcd
->
i_lsn
+
i_size
;
p_vcd
->
origin_lsn
=
p_vcd
->
i_lsn
;
p_vcd
->
i_track
=
i_track
;
p_vcd
->
track_lsn
=
vcdinfo_get_track_lba
(
p_vcd
->
vcd
,
i_track
);
p_vcd
player
->
play_item
.
num
=
p_itemid
->
num
;
p_vcd
player
->
play_item
.
type
=
p_itemid
->
type
;
p_vcd
player
->
i_lsn
=
i_lsn
;
p_vcd
player
->
end_lsn
=
p_vcdplayer
->
i_lsn
+
i_size
;
p_vcd
player
->
origin_lsn
=
p_vcdplayer
->
i_lsn
;
p_vcd
player
->
i_track
=
i_track
;
p_vcd
player
->
track_lsn
=
vcdinfo_get_track_lba
(
p_vcdplayer
->
vcd
,
i_track
);
dbg_print
((
INPUT_DBG_CALL
|
INPUT_DBG_LSN
),
"lsn %u, end LSN: %u item.num %d, item.type %d"
,
p_vcd
->
i_lsn
,
p_vcd
->
end_lsn
,
p_vcd
->
play_item
.
num
,
p_vcd
->
play_item
.
type
);
p_vcd
player
->
i_lsn
,
p_vcdplayer
->
end_lsn
,
p_vcd
player
->
play_item
.
num
,
p_vcdplayer
->
play_item
.
type
);
}
/*
/*
!
Get the next play-item in the list given in the LIDs. Note play-item
here refers to list of play-items for a single LID It shouldn't be
confused with a user's list of favorite things to play or the
"next" field of a LID which moves us to a different LID.
*/
static
bool
_
vcdplayer_inc_play_item
(
access_t
*
p_access
)
vcdplayer_inc_play_item
(
access_t
*
p_access
)
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdplayer_t
*
p_vcdplayer
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
int
noi
;
dbg_print
(
INPUT_DBG_CALL
,
"called pli: %d"
,
p_vcd
->
pdi
);
dbg_print
(
INPUT_DBG_CALL
,
"called pli: %d"
,
p_vcd
player
->
pdi
);
if
(
NULL
==
p_vcd
||
NULL
==
p_vcd
->
pxd
.
pld
)
return
false
;
if
(
NULL
==
p_vcd
player
||
NULL
==
p_vcdplayer
->
pxd
.
pld
)
return
false
;
noi
=
vcdinf_pld_get_noi
(
p_vcd
->
pxd
.
pld
);
noi
=
vcdinf_pld_get_noi
(
p_vcd
player
->
pxd
.
pld
);
if
(
noi
<=
0
)
return
false
;
/* Handle delays like autowait or wait here? */
p_vcd
->
pdi
++
;
p_vcd
player
->
pdi
++
;
if
(
p_vcd
->
pdi
<
0
||
p_vcd
->
pdi
>=
noi
)
return
false
;
if
(
p_vcd
player
->
pdi
<
0
||
p_vcdplayer
->
pdi
>=
noi
)
return
false
;
else
{
uint16_t
trans_itemid_num
=
vcdinf_pld_get_play_item
(
p_vcd
->
pxd
.
pld
,
p_vcd
->
pdi
);
uint16_t
trans_itemid_num
=
vcdinf_pld_get_play_item
(
p_vcd
player
->
pxd
.
pld
,
p_vcd
player
->
pdi
);
vcdinfo_itemid_t
trans_itemid
;
if
(
VCDINFO_INVALID_ITEMID
==
trans_itemid_num
)
return
false
;
vcdinfo_classify_itemid
(
trans_itemid_num
,
&
trans_itemid
);
dbg_print
(
INPUT_DBG_PBC
,
" play-item[%d]: %s"
,
p_vcd
->
pdi
,
vcdinfo_pin2str
(
trans_itemid_num
));
p_vcd
player
->
pdi
,
vcdinfo_pin2str
(
trans_itemid_num
));
return
vcdplayer_play_single_item
(
p_access
,
trans_itemid
);
}
}
...
...
@@ -395,43 +396,43 @@ _vcdplayer_inc_play_item(access_t *p_access)
void
vcdplayer_play
(
access_t
*
p_access
,
vcdinfo_itemid_t
itemid
)
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
dbg_print
(
INPUT_DBG_CALL
,
"called itemid.num: %d itemid.type: %d"
,
itemid
.
num
,
itemid
.
type
);
if
(
!
vcdplayer_pbc_is_on
(
p_vcd
))
{
if
(
!
vcdplayer_pbc_is_on
(
p_vcd
player
))
{
vcdplayer_play_single_item
(
p_access
,
itemid
);
}
else
{
/* PBC on - Itemid.num is LID. */
vcdinfo_obj_t
*
obj
=
p_vcd
->
vcd
;
vcdinfo_obj_t
*
obj
=
p_vcd
player
->
vcd
;
if
(
obj
==
NULL
)
return
;
p_vcd
->
i_lid
=
itemid
.
num
;
vcdinfo_lid_get_pxd
(
obj
,
&
(
p_vcd
->
pxd
),
itemid
.
num
);
p_vcd
player
->
i_lid
=
itemid
.
num
;
vcdinfo_lid_get_pxd
(
obj
,
&
(
p_vcd
player
->
pxd
),
itemid
.
num
);
switch
(
p_vcd
->
pxd
.
descriptor_type
)
{
switch
(
p_vcd
player
->
pxd
.
descriptor_type
)
{
case
PSD_TYPE_SELECTION_LIST
:
case
PSD_TYPE_EXT_SELECTION_LIST
:
{
vcdinfo_itemid_t
trans_itemid
;
uint16_t
trans_itemid_num
;
if
(
p_vcd
->
pxd
.
psd
==
NULL
)
return
;
trans_itemid_num
=
vcdinf_psd_get_itemid
(
p_vcd
->
pxd
.
psd
);
if
(
p_vcd
player
->
pxd
.
psd
==
NULL
)
return
;
trans_itemid_num
=
vcdinf_psd_get_itemid
(
p_vcd
player
->
pxd
.
psd
);
vcdinfo_classify_itemid
(
trans_itemid_num
,
&
trans_itemid
);
p_vcd
->
loop_count
=
1
;
p_vcd
->
loop_item
=
trans_itemid
;
p_vcd
player
->
i_loop
=
1
;
p_vcd
player
->
loop_item
=
trans_itemid
;
vcdplayer_play_single_item
(
p_access
,
trans_itemid
);
break
;
}
case
PSD_TYPE_PLAY_LIST
:
{
if
(
p_vcd
->
pxd
.
pld
==
NULL
)
return
;
p_vcd
->
pdi
=
-
1
;
_
vcdplayer_inc_play_item
(
p_access
);
if
(
p_vcd
player
->
pxd
.
pld
==
NULL
)
return
;
p_vcd
player
->
pdi
=
-
1
;
vcdplayer_inc_play_item
(
p_access
);
break
;
}
...
...
@@ -448,7 +449,7 @@ vcdplayer_play(access_t *p_access, vcdinfo_itemid_t itemid)
vcdplayer_read_status_t
vcdplayer_pbc_nav
(
access_t
*
p_access
,
uint8_t
*
wait_time
)
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
/* We are in playback control. */
vcdinfo_itemid_t
itemid
;
...
...
@@ -456,18 +457,18 @@ vcdplayer_pbc_nav ( access_t * p_access, uint8_t *wait_time )
/* The end of an entry is really the end of the associated
sequence (or track). */
if
(
(
VCDINFO_ITEM_TYPE_ENTRY
==
p_vcd
->
play_item
.
type
)
&&
(
p_vcd
->
i_lsn
<
p_vcd
->
end_lsn
)
)
{
if
(
(
VCDINFO_ITEM_TYPE_ENTRY
==
p_vcd
player
->
play_item
.
type
)
&&
(
p_vcd
player
->
i_lsn
<
p_vcdplayer
->
end_lsn
)
)
{
/* Set up to just continue to the next entry */
p_vcd
->
play_item
.
num
++
;
p_vcd
player
->
play_item
.
num
++
;
dbg_print
(
(
INPUT_DBG_LSN
|
INPUT_DBG_PBC
),
"continuing into next entry: %u"
,
p_vcd
->
play_item
.
num
);
vcdplayer_play
(
p_access
,
p_vcd
->
play_item
);
/* p_vcd->update_title(); */
"continuing into next entry: %u"
,
p_vcd
player
->
play_item
.
num
);
vcdplayer_play
_single_item
(
p_access
,
p_vcdplayer
->
play_item
);
/* p_vcd
player
->update_title(); */
return
READ_BLOCK
;
}
switch
(
p_vcd
->
pxd
.
descriptor_type
)
{
switch
(
p_vcd
player
->
pxd
.
descriptor_type
)
{
case
PSD_TYPE_END_LIST
:
return
READ_END
;
break
;
...
...
@@ -476,8 +477,8 @@ vcdplayer_pbc_nav ( access_t * p_access, uint8_t *wait_time )
return
READ_BLOCK
;
/* Set up for caller process wait time given. */
if
(
p_vcd
->
in_still
)
{
*
wait_time
=
vcdinf_get_wait_time
(
p_vcd
->
pxd
.
pld
);
if
(
p_vcd
player
->
in_still
)
{
*
wait_time
=
vcdinf_get_wait_time
(
p_vcd
player
->
pxd
.
pld
);
dbg_print
((
INPUT_DBG_PBC
|
INPUT_DBG_STILL
),
"playlist wait time: %d"
,
*
wait_time
);
return
READ_STILL_FRAME
;
...
...
@@ -485,7 +486,7 @@ vcdplayer_pbc_nav ( access_t * p_access, uint8_t *wait_time )
/* Wait time has been processed; continue with next entry. */
vcdplayer_update_entry
(
p_access
,
vcdinf_pld_get_next_offset
(
p_vcd
->
pxd
.
pld
),
vcdinf_pld_get_next_offset
(
p_vcd
player
->
pxd
.
pld
),
&
itemid
.
num
,
"next"
);
itemid
.
type
=
VCDINFO_ITEM_TYPE_LID
;
vcdplayer_play
(
p_access
,
itemid
);
...
...
@@ -494,17 +495,17 @@ vcdplayer_pbc_nav ( access_t * p_access, uint8_t *wait_time )
case
PSD_TYPE_SELECTION_LIST
:
/* Selection List (+Ext. for SVCD) */
case
PSD_TYPE_EXT_SELECTION_LIST
:
/* Extended Selection List (VCD2.0) */
{
uint16_t
timeout_offs
=
vcdinf_get_timeout_offset
(
p_vcd
->
pxd
.
psd
);
uint16_t
max_loop
=
vcdinf_get_loop_count
(
p_vcd
->
pxd
.
psd
);
uint16_t
timeout_offs
=
vcdinf_get_timeout_offset
(
p_vcd
player
->
pxd
.
psd
);
uint16_t
max_loop
=
vcdinf_get_loop_count
(
p_vcd
player
->
pxd
.
psd
);
vcdinfo_offset_t
*
offset_timeout_LID
=
vcdinfo_get_offset_t
(
p_vcd
->
vcd
,
timeout_offs
);
vcdinfo_get_offset_t
(
p_vcd
player
->
vcd
,
timeout_offs
);
dbg_print
(
INPUT_DBG_PBC
,
"looped: %d, max_loop %d"
,
p_vcd
->
loop_count
,
max_loop
);
p_vcd
player
->
i_loop
,
max_loop
);
/* Set up for caller process wait time given. */
if
(
p_vcd
->
in_still
)
{
*
wait_time
=
vcdinf_get_timeout_time
(
p_vcd
->
pxd
.
psd
);
if
(
p_vcd
player
->
in_still
)
{
*
wait_time
=
vcdinf_get_timeout_time
(
p_vcd
player
->
pxd
.
psd
);
dbg_print
((
INPUT_DBG_PBC
|
INPUT_DBG_STILL
),
"playlist wait_time: %d"
,
*
wait_time
);
return
READ_STILL_FRAME
;
...
...
@@ -512,11 +513,11 @@ vcdplayer_pbc_nav ( access_t * p_access, uint8_t *wait_time )
/* Wait time has been processed; continue with next entry. */
/* Handle any looping given. */
if
(
max_loop
==
0
||
p_vcd
->
loop_count
<
max_loop
)
{
p_vcd
->
loop_count
++
;
if
(
p_vcd
->
loop_count
==
0x7f
)
p_vcd
->
loop_count
=
0
;
if
(
max_loop
==
0
||
p_vcd
player
->
i_loop
<
max_loop
)
{
p_vcd
player
->
i_loop
++
;
if
(
p_vcd
player
->
i_loop
==
0x7f
)
p_vcdplayer
->
i_loop
=
0
;
VCDSeek
(
p_access
,
0
);
/* if (p_vcd
->in_still) p_vcd
->force_redisplay();*/
/* if (p_vcd
player->in_still) p_vcdplayer
->force_redisplay();*/
return
READ_BLOCK
;
}
...
...
@@ -531,14 +532,14 @@ vcdplayer_pbc_nav ( access_t * p_access, uint8_t *wait_time )
vcdplayer_play
(
p_access
,
itemid
);
return
READ_BLOCK
;
}
else
{
int
num_selections
=
vcdinf_get_num_selections
(
p_vcd
->
pxd
.
psd
);
if
(
num
_selections
>
0
)
{
int
i_selections
=
vcdinf_get_num_selections
(
p_vcdplayer
->
pxd
.
psd
);
if
(
i
_selections
>
0
)
{
/* Pick a random selection. */
unsigned
int
bsn
=
vcdinf_get_bsn
(
p_vcd
->
pxd
.
psd
);
unsigned
int
bsn
=
vcdinf_get_bsn
(
p_vcd
player
->
pxd
.
psd
);
int
rand_selection
=
bsn
+
(
int
)
((
num
_selections
+
0
.
0
)
*
rand
()
/
(
RAND_MAX
+
1
.
0
));
lid_t
rand_lid
=
vcdinfo_selection_get_lid
(
p_vcd
->
vcd
,
p_vcd
->
i_lid
,
(
int
)
((
i
_selections
+
0
.
0
)
*
rand
()
/
(
RAND_MAX
+
1
.
0
));
lid_t
rand_lid
=
vcdinfo_selection_get_lid
(
p_vcd
player
->
vcd
,
p_vcd
player
->
i_lid
,
rand_selection
);
itemid
.
num
=
rand_lid
;
itemid
.
type
=
VCDINFO_ITEM_TYPE_LID
;
...
...
@@ -546,7 +547,7 @@ vcdplayer_pbc_nav ( access_t * p_access, uint8_t *wait_time )
rand_selection
-
bsn
,
rand_lid
);
vcdplayer_play
(
p_access
,
itemid
);
return
READ_BLOCK
;
}
else
if
(
p_vcd
->
in_still
)
{
}
else
if
(
p_vcd
player
->
in_still
)
{
/* Hack: Just go back and do still again */
sleep
(
1
);
return
READ_STILL_FRAME
;
...
...
@@ -586,16 +587,16 @@ vcdplayer_read (access_t * p_access, uint8_t *p_buf)
/* p_access->handle_events (); */
uint8_t
wait_time
;
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
if
(
p_vcd
->
i_lsn
>
p_vcd
->
end_lsn
)
{
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
if
(
p_vcd
player
->
i_lsn
>
p_vcdplayer
->
end_lsn
)
{
vcdplayer_read_status_t
read_status
;
/* We've run off of the end of this entry. Do we continue or stop? */
dbg_print
(
(
INPUT_DBG_LSN
|
INPUT_DBG_PBC
),
"end reached, cur: %u, end: %u
\n
"
,
p_vcd
->
i_lsn
,
p_vcd
->
end_lsn
);
"end reached, cur: %u, end: %u
\n
"
,
p_vcd
player
->
i_lsn
,
p_vcdplayer
->
end_lsn
);
handle_item_continuation:
read_status
=
vcdplayer_pbc_is_on
(
p_vcd
)
read_status
=
vcdplayer_pbc_is_on
(
p_vcd
player
)
?
vcdplayer_pbc_nav
(
p_access
,
&
wait_time
)
:
vcdplayer_non_pbc_nav
(
p_access
,
&
wait_time
);
...
...
@@ -617,7 +618,7 @@ vcdplayer_read (access_t * p_access, uint8_t *p_buf)
*/
{
CdIo
*
p_img
=
vcdinfo_get_cd_image
(
p_vcd
->
vcd
);
CdIo
*
p_img
=
vcdinfo_get_cd_image
(
p_vcd
player
->
vcd
);
typedef
struct
{
uint8_t
subheader
[
CDIO_CD_SUBHEADER_SIZE
];
uint8_t
data
[
M2F2_SECTOR_SIZE
];
...
...
@@ -626,18 +627,18 @@ vcdplayer_read (access_t * p_access, uint8_t *p_buf)
vcdsector_t
vcd_sector
;
do
{
if
(
cdio_read_mode2_sector
(
p_img
,
&
vcd_sector
,
p_vcd
->
i_lsn
,
true
)
!=
0
)
{
if
(
cdio_read_mode2_sector
(
p_img
,
&
vcd_sector
,
p_vcd
player
->
i_lsn
,
true
)
!=
0
)
{
dbg_print
(
INPUT_DBG_LSN
,
"read error
\n
"
);
p_vcd
->
i_lsn
++
;
p_vcd
player
->
i_lsn
++
;
return
READ_ERROR
;
}
p_vcd
->
i_lsn
++
;
p_vcd
player
->
i_lsn
++
;
if
(
p_vcd
->
i_lsn
>=
p_vcd
->
end_lsn
)
{
/* We've run off of the end of p_vcd entry. Do we continue or stop? */
if
(
p_vcd
player
->
i_lsn
>=
p_vcdplayer
->
end_lsn
)
{
/* We've run off of the end of p_vcd
player
entry. Do we continue or stop? */
dbg_print
(
(
INPUT_DBG_LSN
|
INPUT_DBG_PBC
),
"end reached in reading, cur: %u, end: %u
\n
"
,
p_vcd
->
i_lsn
,
p_vcd
->
end_lsn
);
p_vcd
player
->
i_lsn
,
p_vcdplayer
->
end_lsn
);
break
;
}
...
...
@@ -647,7 +648,7 @@ vcdplayer_read (access_t * p_access, uint8_t *p_buf)
*/
}
while
((
vcd_sector
.
subheader
[
2
]
&~
0x01
)
==
0x60
);
if
(
p_vcd
->
i_lsn
>=
p_vcd
->
end_lsn
)
if
(
p_vcd
player
->
i_lsn
>=
p_vcdplayer
->
end_lsn
)
/* We've run off of the end of this entry. Do we continue or stop? */
goto
handle_item_continuation
;
...
...
@@ -656,48 +657,6 @@ vcdplayer_read (access_t * p_access, uint8_t *p_buf)
}
}
/*!
Get the next play-item in the list given in the LIDs. Note play-item
here refers to list of play-items for a single LID It shouldn't be
confused with a user's list of favorite things to play or the
"next" field of a LID which moves us to a different LID.
*/
bool
vcdplayer_inc_play_item
(
access_t
*
p_access
)
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
int
noi
;
dbg_print
(
INPUT_DBG_CALL
,
"called pli: %d"
,
p_vcd
->
pdi
);
if
(
NULL
==
p_vcd
||
NULL
==
p_vcd
->
pxd
.
pld
)
return
false
;
noi
=
vcdinf_pld_get_noi
(
p_vcd
->
pxd
.
pld
);
if
(
noi
<=
0
)
return
false
;
/* Handle delays like autowait or wait here? */
p_vcd
->
pdi
++
;
if
(
p_vcd
->
pdi
<
0
||
p_vcd
->
pdi
>=
noi
)
return
false
;
else
{
uint16_t
trans_itemid_num
=
vcdinf_pld_get_play_item
(
p_vcd
->
pxd
.
pld
,
p_vcd
->
pdi
);
vcdinfo_itemid_t
trans_itemid
;
if
(
VCDINFO_INVALID_ITEMID
==
trans_itemid_num
)
return
false
;
vcdinfo_classify_itemid
(
trans_itemid_num
,
&
trans_itemid
);
dbg_print
(
INPUT_DBG_PBC
,
" play-item[%d]: %s"
,
p_vcd
->
pdi
,
vcdinfo_pin2str
(
trans_itemid_num
));
vcdplayer_play
(
p_access
,
trans_itemid
);
return
VLC_SUCCESS
;
}
}
/*!
Play item assocated with the "default" selection.
...
...
@@ -706,46 +665,46 @@ vcdplayer_inc_play_item( access_t *p_access )
bool
vcdplayer_play_default
(
access_t
*
p_access
)
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdinfo_itemid_t
itemid
;
if
(
!
p_vcd
)
{
if
(
!
p_vcd
player
)
{
dbg_print
(
(
INPUT_DBG_CALL
|
INPUT_DBG_PBC
),
"null p_vcd"
);
"null p_vcd
player
"
);
return
VLC_EGENERIC
;
}
dbg_print
(
(
INPUT_DBG_CALL
|
INPUT_DBG_PBC
),
"current: %d"
,
p_vcd
->
play_item
.
num
);
"current: %d"
,
p_vcd
player
->
play_item
.
num
);
itemid
.
type
=
p_vcd
->
play_item
.
type
;
itemid
.
type
=
p_vcd
player
->
play_item
.
type
;
if
(
vcdplayer_pbc_is_on
(
p_vcd
))
{
if
(
vcdplayer_pbc_is_on
(
p_vcd
player
))
{
#if defined(LIBVCD_VERSION)
lid_t
lid
=
vcdinfo_get_multi_default_lid
(
p_vcd
->
vcd
,
p_vcd
->
i_lid
,
p_vcd
->
i_lsn
);
lid_t
lid
=
vcdinfo_get_multi_default_lid
(
p_vcd
player
->
vcd
,
p_vcdplayer
->
i_lid
,
p_vcd
player
->
i_lsn
);
if
(
VCDINFO_INVALID_LID
!=
lid
)
{
itemid
.
num
=
lid
;
itemid
.
type
=
VCDINFO_ITEM_TYPE_LID
;
dbg_print
(
INPUT_DBG_PBC
,
"DEFAULT to %d"
,
itemid
.
num
);
}
else
{
dbg_print
(
INPUT_DBG_PBC
,
"no DEFAULT for LID %d"
,
p_vcd
->
i_lid
);
dbg_print
(
INPUT_DBG_PBC
,
"no DEFAULT for LID %d"
,
p_vcd
player
->
i_lid
);
}
#else
vcdinfo_lid_get_pxd
(
p_vcd
->
vcd
,
&
(
p_vcd
->
pxd
),
p_vcd
->
i_lid
);
vcdinfo_lid_get_pxd
(
p_vcd
player
->
vcd
,
&
(
p_vcdplayer
->
pxd
),
p_vcdplayer
->
i_lid
);
switch
(
p_vcd
->
pxd
.
descriptor_type
)
{
switch
(
p_vcd
player
->
pxd
.
descriptor_type
)
{
case
PSD_TYPE_SELECTION_LIST
:
case
PSD_TYPE_EXT_SELECTION_LIST
:
if
(
p_vcd
->
pxd
.
psd
==
NULL
)
return
false
;
if
(
p_vcd
player
->
pxd
.
psd
==
NULL
)
return
false
;
vcdplayer_update_entry
(
p_access
,
vcdinfo_get_default_offset
(
p_vcd
->
vcd
,
p_vcd
->
i_lid
),
vcdinfo_get_default_offset
(
p_vcd
player
->
vcd
,
p_vcd
player
->
i_lid
),
&
itemid
.
num
,
"default"
);
break
;
...
...
@@ -763,11 +722,11 @@ vcdplayer_play_default( access_t * p_access )
/* PBC is not on. "default" selection beginning of current
selection . */
p_vcd
->
play_item
.
num
=
p_vcd
->
play_item
.
num
;
p_vcd
player
->
play_item
.
num
=
p_vcdplayer
->
play_item
.
num
;
}
/** ??? p_vcd->update_title(); ***/
/** ??? p_vcd
player
->update_title(); ***/
vcdplayer_play
(
p_access
,
itemid
);
return
VLC_SUCCESS
;
...
...
@@ -781,38 +740,38 @@ vcdplayer_play_default( access_t * p_access )
bool
vcdplayer_play_next
(
access_t
*
p_access
)
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdinfo_obj_t
*
p_
obj
;
vcdinfo_obj_t
*
p_
vcdinfo
;
vcdinfo_itemid_t
itemid
;
if
(
!
p_vcd
)
return
false
;
if
(
!
p_vcd
player
)
return
false
;
dbg_print
(
(
INPUT_DBG_CALL
|
INPUT_DBG_PBC
),
"current: %d"
,
p_vcd
->
play_item
.
num
);
"current: %d"
,
p_vcd
player
->
play_item
.
num
);
p_
obj
=
p_vcd
->
vcd
;
p_
vcdinfo
=
p_vcdplayer
->
vcd
;
itemid
.
type
=
p_vcd
->
play_item
.
type
;
itemid
.
type
=
p_vcd
player
->
play_item
.
type
;
if
(
vcdplayer_pbc_is_on
(
p_vcd
))
{
if
(
vcdplayer_pbc_is_on
(
p_vcd
player
))
{
vcdinfo_lid_get_pxd
(
p_
obj
,
&
(
p_vcd
->
pxd
),
p_vcd
->
i_lid
);
vcdinfo_lid_get_pxd
(
p_
vcdinfo
,
&
(
p_vcdplayer
->
pxd
),
p_vcdplayer
->
i_lid
);
switch
(
p_vcd
->
pxd
.
descriptor_type
)
{
switch
(
p_vcd
player
->
pxd
.
descriptor_type
)
{
case
PSD_TYPE_SELECTION_LIST
:
case
PSD_TYPE_EXT_SELECTION_LIST
:
if
(
p_vcd
->
pxd
.
psd
==
NULL
)
return
false
;
if
(
p_vcd
player
->
pxd
.
psd
==
NULL
)
return
false
;
vcdplayer_update_entry
(
p_access
,
vcdinf_psd_get_next_offset
(
p_vcd
->
pxd
.
psd
),
vcdinf_psd_get_next_offset
(
p_vcd
player
->
pxd
.
psd
),
&
itemid
.
num
,
"next"
);
itemid
.
type
=
VCDINFO_ITEM_TYPE_LID
;
break
;
case
PSD_TYPE_PLAY_LIST
:
if
(
p_vcd
->
pxd
.
pld
==
NULL
)
return
false
;
if
(
p_vcd
player
->
pxd
.
pld
==
NULL
)
return
false
;
vcdplayer_update_entry
(
p_access
,
vcdinf_pld_get_next_offset
(
p_vcd
->
pxd
.
pld
),
vcdinf_pld_get_next_offset
(
p_vcd
player
->
pxd
.
pld
),
&
itemid
.
num
,
"next"
);
itemid
.
type
=
VCDINFO_ITEM_TYPE_LID
;
break
;
...
...
@@ -828,26 +787,26 @@ vcdplayer_play_next( access_t * p_access )
int
max_entry
=
0
;
switch
(
p_vcd
->
play_item
.
type
)
{
switch
(
p_vcd
player
->
play_item
.
type
)
{
case
VCDINFO_ITEM_TYPE_ENTRY
:
case
VCDINFO_ITEM_TYPE_SEGMENT
:
case
VCDINFO_ITEM_TYPE_TRACK
:
switch
(
p_vcd
->
play_item
.
type
)
{
switch
(
p_vcd
player
->
play_item
.
type
)
{
case
VCDINFO_ITEM_TYPE_ENTRY
:
max_entry
=
p_vcd
->
i_entries
;
max_entry
=
p_vcd
player
->
i_entries
;
break
;
case
VCDINFO_ITEM_TYPE_SEGMENT
:
max_entry
=
p_vcd
->
i_segments
;
max_entry
=
p_vcd
player
->
i_segments
;
break
;
case
VCDINFO_ITEM_TYPE_TRACK
:
max_entry
=
p_vcd
->
i_tracks
;
max_entry
=
p_vcd
player
->
i_tracks
;
break
;
default:
;
/* Handle exceptional cases below */
}
if
(
p_vcd
->
play_item
.
num
+
1
<
max_entry
)
{
itemid
.
num
=
p_vcd
->
play_item
.
num
+
1
;
if
(
p_vcd
player
->
play_item
.
num
+
1
<
max_entry
)
{
itemid
.
num
=
p_vcd
player
->
play_item
.
num
+
1
;
}
else
{
LOG_WARN
(
"At the end - non-PBC 'next' not possible here"
);
return
false
;
...
...
@@ -866,7 +825,7 @@ vcdplayer_play_next( access_t * p_access )
}
}
/** ??? p_vcd->update_title(); ***/
/** ??? p_vcd
player
->update_title(); ***/
vcdplayer_play
(
p_access
,
itemid
);
return
VLC_SUCCESS
;
...
...
@@ -880,33 +839,33 @@ vcdplayer_play_next( access_t * p_access )
bool
vcdplayer_play_prev
(
access_t
*
p_access
)
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdinfo_obj_t
*
p_
obj
=
p_vcd
->
vcd
;
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdinfo_obj_t
*
p_
vcdinfo
=
p_vcdplayer
->
vcd
;
vcdinfo_itemid_t
itemid
;
dbg_print
(
(
INPUT_DBG_CALL
|
INPUT_DBG_PBC
),
"current: %d"
,
p_vcd
->
play_item
.
num
);
"current: %d"
,
p_vcd
player
->
play_item
.
num
);
itemid
.
type
=
p_vcd
->
play_item
.
type
;
itemid
.
type
=
p_vcd
player
->
play_item
.
type
;
if
(
vcdplayer_pbc_is_on
(
p_vcd
))
{
if
(
vcdplayer_pbc_is_on
(
p_vcd
player
))
{
vcdinfo_lid_get_pxd
(
p_
obj
,
&
(
p_vcd
->
pxd
),
p_vcd
->
i_lid
);
vcdinfo_lid_get_pxd
(
p_
vcdinfo
,
&
(
p_vcdplayer
->
pxd
),
p_vcdplayer
->
i_lid
);
switch
(
p_vcd
->
pxd
.
descriptor_type
)
{
switch
(
p_vcd
player
->
pxd
.
descriptor_type
)
{
case
PSD_TYPE_SELECTION_LIST
:
case
PSD_TYPE_EXT_SELECTION_LIST
:
if
(
p_vcd
->
pxd
.
psd
==
NULL
)
return
false
;
if
(
p_vcd
player
->
pxd
.
psd
==
NULL
)
return
false
;
vcdplayer_update_entry
(
p_access
,
vcdinf_psd_get_prev_offset
(
p_vcd
->
pxd
.
psd
),
vcdinf_psd_get_prev_offset
(
p_vcd
player
->
pxd
.
psd
),
&
itemid
.
num
,
"prev"
);
itemid
.
type
=
VCDINFO_ITEM_TYPE_LID
;
break
;
case
PSD_TYPE_PLAY_LIST
:
if
(
p_vcd
->
pxd
.
pld
==
NULL
)
return
false
;
if
(
p_vcd
player
->
pxd
.
pld
==
NULL
)
return
false
;
vcdplayer_update_entry
(
p_access
,
vcdinf_pld_get_prev_offset
(
p_vcd
->
pxd
.
pld
),
vcdinf_pld_get_prev_offset
(
p_vcd
player
->
pxd
.
pld
),
&
itemid
.
num
,
"prev"
);
itemid
.
type
=
VCDINFO_ITEM_TYPE_LID
;
break
;
...
...
@@ -920,11 +879,11 @@ vcdplayer_play_prev( access_t * p_access )
/* PBC is not on. "Prev" selection is play_item.num-1 if possible. */
int
min_entry
=
(
VCDINFO_ITEM_TYPE_ENTRY
==
p_vcd
->
play_item
.
type
)
int
min_entry
=
(
VCDINFO_ITEM_TYPE_ENTRY
==
p_vcd
player
->
play_item
.
type
)
?
0
:
1
;
if
(
p_vcd
->
play_item
.
num
>
min_entry
)
{
itemid
.
num
=
p_vcd
->
play_item
.
num
-
1
;
if
(
p_vcd
player
->
play_item
.
num
>
min_entry
)
{
itemid
.
num
=
p_vcd
player
->
play_item
.
num
-
1
;
}
else
{
LOG_WARN
(
"At the beginning - non-PBC 'prev' not possible here"
);
return
false
;
...
...
@@ -932,7 +891,7 @@ vcdplayer_play_prev( access_t * p_access )
}
/** ??? p_vcd->update_title(); ***/
/** ??? p_vcd
player
->update_title(); ***/
vcdplayer_play
(
p_access
,
itemid
);
return
VLC_SUCCESS
;
...
...
@@ -946,33 +905,33 @@ vcdplayer_play_prev( access_t * p_access )
bool
vcdplayer_play_return
(
access_t
*
p_access
)
{
vcdplayer_t
*
p_vcd
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdinfo_obj_t
*
p_
obj
=
p_vcd
->
vcd
;
vcdplayer_t
*
p_vcd
player
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdinfo_obj_t
*
p_
vcdinfo
=
p_vcdplayer
->
vcd
;
vcdinfo_itemid_t
itemid
;
dbg_print
(
(
INPUT_DBG_CALL
|
INPUT_DBG_PBC
),
"current: %d"
,
p_vcd
->
play_item
.
num
);
"current: %d"
,
p_vcd
player
->
play_item
.
num
);
itemid
.
type
=
p_vcd
->
play_item
.
type
;
itemid
.
type
=
p_vcd
player
->
play_item
.
type
;
if
(
vcdplayer_pbc_is_on
(
p_vcd
))
{
if
(
vcdplayer_pbc_is_on
(
p_vcd
player
))
{
vcdinfo_lid_get_pxd
(
p_
obj
,
&
(
p_vcd
->
pxd
),
p_vcd
->
i_lid
);
vcdinfo_lid_get_pxd
(
p_
vcdinfo
,
&
(
p_vcdplayer
->
pxd
),
p_vcdplayer
->
i_lid
);
switch
(
p_vcd
->
pxd
.
descriptor_type
)
{
switch
(
p_vcd
player
->
pxd
.
descriptor_type
)
{
case
PSD_TYPE_SELECTION_LIST
:
case
PSD_TYPE_EXT_SELECTION_LIST
:
if
(
p_vcd
->
pxd
.
psd
==
NULL
)
return
false
;
if
(
p_vcd
player
->
pxd
.
psd
==
NULL
)
return
false
;
vcdplayer_update_entry
(
p_access
,
vcdinf_psd_get_return_offset
(
p_vcd
->
pxd
.
psd
),
vcdinf_psd_get_return_offset
(
p_vcd
player
->
pxd
.
psd
),
&
itemid
.
num
,
"return"
);
itemid
.
type
=
VCDINFO_ITEM_TYPE_LID
;
break
;
case
PSD_TYPE_PLAY_LIST
:
if
(
p_vcd
->
pxd
.
pld
==
NULL
)
return
false
;
if
(
p_vcd
player
->
pxd
.
pld
==
NULL
)
return
false
;
vcdplayer_update_entry
(
p_access
,
vcdinf_pld_get_return_offset
(
p_vcd
->
pxd
.
pld
),
vcdinf_pld_get_return_offset
(
p_vcd
player
->
pxd
.
pld
),
&
itemid
.
num
,
"return"
);
itemid
.
type
=
VCDINFO_ITEM_TYPE_LID
;
break
;
...
...
@@ -986,12 +945,12 @@ vcdplayer_play_return( access_t * p_access )
/* PBC is not on. "Return" selection is min_entry if possible. */
p_vcd
->
play_item
.
num
=
(
VCDINFO_ITEM_TYPE_ENTRY
==
p_vcd
->
play_item
.
type
)
p_vcd
player
->
play_item
.
num
=
(
VCDINFO_ITEM_TYPE_ENTRY
==
p_vcdplayer
->
play_item
.
type
)
?
0
:
1
;
}
/** ??? p_vcd->update_title(); ***/
/** ??? p_vcd
player
->update_title(); ***/
vcdplayer_play
(
p_access
,
itemid
);
return
VLC_SUCCESS
;
...
...
modules/access/vcdx/vcdplayer.h
View file @
79053042
...
...
@@ -33,7 +33,7 @@
#define INPUT_DBG_EVENT 2
/* input (keyboard/mouse) events */
#define INPUT_DBG_MRL 4
/* MRL parsing */
#define INPUT_DBG_EXT 8
/* Calls from external routines */
#define INPUT_DBG_CALL 16
/*
all
calls */
#define INPUT_DBG_CALL 16
/*
routine
calls */
#define INPUT_DBG_LSN 32
/* LSN changes */
#define INPUT_DBG_PBC 64
/* Playback control */
#define INPUT_DBG_CDIO 128
/* Debugging from CDIO */
...
...
@@ -45,7 +45,7 @@
#define INPUT_DEBUG 1
#if INPUT_DEBUG
#define dbg_print(mask, s, args...) \
if (p_vcd
&& p_vcd
->i_debug & mask) \
if (p_vcd
player && p_vcdplayer
->i_debug & mask) \
msg_Dbg(p_access, "%s: "s, __func__ , ##args)
#else
#define dbg_print(mask, s, args...)
...
...
@@ -65,26 +65,22 @@ typedef struct {
size_t
size
;
/* size in sector units of play item. */
}
vcdplayer_play_item_info_t
;
/* vcdplayer_read return status */
typedef
enum
{
READ_BLOCK
,
READ_STILL_FRAME
,
READ_ERROR
,
READ_END
,
}
vcdplayer_read_status_t
;
/*****************************************************************************
* vcdplayer_t: VCD information
*****************************************************************************/
typedef
struct
thread_vcd_data
_s
typedef
struct
vcdplayer_input
_s
{
vcdinfo_obj_t
*
vcd
;
/* CD device descriptor */
/* User-settable options */
/*------------------------------------------------------------------
User-settable options
--------------------------------------------------------------*/
unsigned
int
i_debug
;
/* Debugging mask */
unsigned
int
i_blocks_per_read
;
/* number of blocks per read */
/* Current State: position */
/*-------------------------------------------------------------
Playback control fields
--------------------------------------------------------------*/
bool
in_still
;
/* true if in still */
int
i_lid
;
/* LID that play item is in. Implies
PBC is on. VCDPLAYER_BAD_ENTRY if
...
...
@@ -98,11 +94,15 @@ typedef struct thread_vcd_data_s
vcdinfo_itemid_t
loop_item
;
/* Where do we loop back to?
Meaningful only in a selection
list */
int
loop_count
;
/* # of times play-item has been
int
i_loop
;
/* # of times play-item has been
played. Meaningful only in a
selection list. */
track_t
i_track
;
/* Current track number */
lsn_t
i_lsn
;
/* Current logical sector number */
track_t
i_track
;
/* current track number */
/*-----------------------------------
location fields
------------------------------------*/
lsn_t
i_lsn
;
/* LSN of where we are right now */
lsn_t
end_lsn
;
/* LSN of end of current
entry/segment/track. This block
can be read (and is not one after
...
...
@@ -118,8 +118,11 @@ typedef struct thread_vcd_data_s
bool
b_valid_ep
;
/* Valid entry points flag */
bool
b_end_of_track
;
/* If the end of track was reached */
/* Information about (S)VCD */
char
*
psz_source
;
/* (S)VCD drive or image filename */
/*--------------------------------------------------------------
(S)VCD Medium information
---------------------------------------------------------------*/
char
*
psz_source
;
/* (S)VCD drive or image filename */
bool
b_svd
;
/* true if we have SVD info */
vlc_meta_t
*
p_meta
;
track_t
i_tracks
;
/* # of playable MPEG tracks. This is
...
...
@@ -133,7 +136,7 @@ typedef struct thread_vcd_data_s
unsigned
int
i_lids
;
/* # of List IDs */
/* Tracks, segment, and entry information. The number of entries for
each is given by the corresponding
num
_* field above. */
each is given by the corresponding
i
_* field above. */
vcdplayer_play_item_info_t
*
track
;
vcdplayer_play_item_info_t
*
segment
;
vcdplayer_play_item_info_t
*
entry
;
...
...
@@ -156,18 +159,23 @@ typedef struct thread_vcd_data_s
}
vcdplayer_t
;
/*!
Get the next play-item in the list given in the LIDs. Note play-item
here refers to list of play-items for a single LID It shouldn't be
confused with a user's list of favorite things to play or the
"next" field of a LID which moves us to a different LID.
*/
bool
vcdplayer_inc_play_item
(
access_t
*
p_access
);
/* vcdplayer_read return status */
typedef
enum
{
READ_BLOCK
,
READ_STILL_FRAME
,
READ_ERROR
,
READ_END
,
}
vcdplayer_read_status_t
;
/* ----------------------------------------------------------------------
Function Prototypes
-----------------------------------------------------------------------*/
/*!
Return true if playback control (PBC) is on
*/
bool
vcdplayer_pbc_is_on
(
const
vcdplayer_t
*
p_
this
);
bool
vcdplayer_pbc_is_on
(
const
vcdplayer_t
*
p_
vcdplayer
);
/*!
Play item assocated with the "default" selection.
...
...
@@ -207,11 +215,6 @@ void vcdplayer_set_origin(access_t *p_access, lsn_t i_lsn, track_t i_track,
void
vcdplayer_play
(
access_t
*
p_access
,
vcdinfo_itemid_t
itemid
);
vcdplayer_read_status_t
vcdplayer_pbc_nav
(
access_t
*
p_access
,
uint8_t
*
wait_time
);
vcdplayer_read_status_t
vcdplayer_non_pbc_nav
(
access_t
*
p_access
,
uint8_t
*
wait_time
);
vcdplayer_read_status_t
vcdplayer_read
(
access_t
*
p_access_t
,
uint8_t
*
p_buf
);
#endif
/* _VCDPLAYER_H_ */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment