Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
ded081bc
Commit
ded081bc
authored
May 30, 2009
by
JP Dinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vcdx: 100% cosmetics; indentation reformatting.
parent
f5078293
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
459 additions
and
475 deletions
+459
-475
modules/access/vcdx/access.c
modules/access/vcdx/access.c
+459
-475
No files found.
modules/access/vcdx/access.c
View file @
ded081bc
...
@@ -87,52 +87,50 @@ static access_t *p_vcd_access = NULL;
...
@@ -87,52 +87,50 @@ static access_t *p_vcd_access = NULL;
static
void
static
void
cdio_log_handler
(
cdio_log_level_t
level
,
const
char
message
[])
cdio_log_handler
(
cdio_log_level_t
level
,
const
char
message
[])
{
{
const
vcdplayer_t
*
p_vcdplayer
=
(
vcdplayer_t
*
)
p_vcd_access
->
p_sys
;
const
vcdplayer_t
*
p_vcdplayer
=
(
vcdplayer_t
*
)
p_vcd_access
->
p_sys
;
switch
(
level
)
{
switch
(
level
)
{
case
CDIO_LOG_DEBUG
:
case
CDIO_LOG_DEBUG
:
case
CDIO_LOG_INFO
:
case
CDIO_LOG_INFO
:
if
(
p_vcdplayer
->
i_debug
&
INPUT_DBG_CDIO
)
if
(
p_vcdplayer
->
i_debug
&
INPUT_DBG_CDIO
)
msg_Dbg
(
p_vcd_access
,
"%s"
,
message
);
msg_Dbg
(
p_vcd_access
,
"%s"
,
message
);
break
;
break
;
case
CDIO_LOG_WARN
:
case
CDIO_LOG_WARN
:
msg_Warn
(
p_vcd_access
,
"%s"
,
message
);
msg_Warn
(
p_vcd_access
,
"%s"
,
message
);
break
;
break
;
case
CDIO_LOG_ERROR
:
case
CDIO_LOG_ERROR
:
case
CDIO_LOG_ASSERT
:
case
CDIO_LOG_ASSERT
:
msg_Err
(
p_vcd_access
,
"%s"
,
message
);
msg_Err
(
p_vcd_access
,
"%s"
,
message
);
break
;
break
;
default:
default:
msg_Warn
(
p_vcd_access
,
"%s
\n
%s %d"
,
message
,
msg_Warn
(
p_vcd_access
,
"%s
\n
%s %d"
,
message
,
"The above message had unknown log level"
,
"The above message had unknown log level"
,
level
);
level
);
}
}
return
;
return
;
}
}
/* process messages that originate from vcdinfo. */
/* process messages that originate from vcdinfo. */
static
void
static
void
vcd_log_handler
(
vcd_log_level_t
level
,
const
char
message
[])
vcd_log_handler
(
vcd_log_level_t
level
,
const
char
message
[])
{
{
vcdplayer_t
*
p_vcdplayer
=
(
vcdplayer_t
*
)
p_vcd_access
->
p_sys
;
vcdplayer_t
*
p_vcdplayer
=
(
vcdplayer_t
*
)
p_vcd_access
->
p_sys
;
switch
(
level
)
{
switch
(
level
)
{
case
VCD_LOG_DEBUG
:
case
VCD_LOG_DEBUG
:
case
VCD_LOG_INFO
:
case
VCD_LOG_INFO
:
if
(
p_vcdplayer
->
i_debug
&
INPUT_DBG_VCDINFO
)
if
(
p_vcdplayer
->
i_debug
&
INPUT_DBG_VCDINFO
)
msg_Dbg
(
p_vcd_access
,
"%s"
,
message
);
msg_Dbg
(
p_vcd_access
,
"%s"
,
message
);
break
;
break
;
case
VCD_LOG_WARN
:
case
VCD_LOG_WARN
:
msg_Warn
(
p_vcd_access
,
"%s"
,
message
);
msg_Warn
(
p_vcd_access
,
"%s"
,
message
);
break
;
break
;
case
VCD_LOG_ERROR
:
case
VCD_LOG_ERROR
:
case
VCD_LOG_ASSERT
:
case
VCD_LOG_ASSERT
:
msg_Err
(
p_vcd_access
,
"%s"
,
message
);
msg_Err
(
p_vcd_access
,
"%s"
,
message
);
break
;
break
;
default:
default:
msg_Warn
(
p_vcd_access
,
"%s
\n
%s %d"
,
message
,
msg_Warn
(
p_vcd_access
,
"%s
\n
%s %d"
,
message
,
"The above message had unknown vcdimager log level"
,
"The above message had unknown vcdimager log level"
,
level
);
level
);
}
}
return
;
return
;
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -165,77 +163,74 @@ VCDReadBlock( access_t * p_access )
...
@@ -165,77 +163,74 @@ VCDReadBlock( access_t * p_access )
p_buf
=
(
uint8_t
*
)
p_block
->
p_buffer
;
p_buf
=
(
uint8_t
*
)
p_block
->
p_buffer
;
for
(
i_read
=
0
;
i_read
<
i_blocks
;
i_read
++
)
for
(
i_read
=
0
;
i_read
<
i_blocks
;
i_read
++
)
{
{
vcdplayer_read_status_t
read_status
=
vcdplayer_read
(
p_access
,
p_buf
);
vcdplayer_read_status_t
read_status
=
vcdplayer_read
(
p_access
,
p_buf
);
p_access
->
info
.
i_pos
+=
M2F2_SECTOR_SIZE
;
p_access
->
info
.
i_pos
+=
M2F2_SECTOR_SIZE
;
switch
(
read_status
)
{
switch
(
read_status
)
{
case
READ_END
:
case
READ_END
:
/* End reached. Return NULL to indicated this. */
/* End reached. Return NULL to indicated this. */
/* We also set the postion to the end so the higher level
/* We also set the postion to the end so the higher level
(demux?) doesn't try to keep reading. If everything works out
(demux?) doesn't try to keep reading. If everything works out
right this shouldn't have to happen.
right this shouldn't have to happen.
*/
*/
#if 0
#if 0
if
( p_access->info.i_pos != p_access->info.i_size ) {
if
( p_access->info.i_pos != p_access->info.i_size ) {
msg_Warn( p_access,
msg_Warn( p_access,
"At end but pos (%llu) is not size (%llu). Adjusting.",
"At end but pos (%llu) is not size (%llu). Adjusting.",
p_access->info.i_pos, p_access->info.i_size );
p_access->info.i_pos, p_access->info.i_size );
p_access->info.i_pos = p_access->info.i_size;
p_access->info.i_pos = p_access->info.i_size;
}
}
#endif
#endif
block_Release
(
p_block
);
block_Release
(
p_block
);
return
NULL
;
return
NULL
;
case
READ_ERROR
:
case
READ_ERROR
:
/* Some sort of error. Should we increment lsn? to skip block?
/* Some sort of error. Should we increment lsn? to skip block? */
*/
block_Release
(
p_block
);
block_Release
(
p_block
);
return
NULL
;
return
NULL
;
case
READ_STILL_FRAME
:
case
READ_STILL_FRAME
:
{
/* FIXME The below should be done in an event thread.
/* FIXME The below should be done in an event thread.
Until then...
Until then...
*/
*/
#if 1
#if 1
msleep
(
MILLISECONDS_PER_SEC
*
*
p_buf
);
msleep
(
MILLISECONDS_PER_SEC
*
*
p_buf
);
VCDSetOrigin
(
p_access
,
p_vcdplayer
->
origin_lsn
,
p_vcdplayer
->
i_track
,
VCDSetOrigin
(
p_access
,
p_vcdplayer
->
origin_lsn
,
&
(
p_vcdplayer
->
play_item
));
p_vcdplayer
->
i_track
,
&
(
p_vcdplayer
->
play_item
));
// p_vcd->in_still = false;
// p_vcd->in_still = false;
dbg_print
(
INPUT_DBG_STILL
,
"still wait time done"
);
dbg_print
(
INPUT_DBG_STILL
,
"still wait time done"
);
#else
#else
vcdIntfStillTime
(
p_vcdplayer
->
p_intf
,
*
p_buf
);
vcdIntfStillTime
(
p_vcdplayer
->
p_intf
,
*
p_buf
);
#endif
#endif
block_Release
(
p_block
);
block_Release
(
p_block
);
return
NULL
;
return
NULL
;
default:
case
READ_BLOCK
:
/* Read buffer */
break
;
}
}
default:
p_buf
+=
M2F2_SECTOR_SIZE
;
case
READ_BLOCK
:
/* Update seekpoint */
/* Read buffer */
if
(
VCDINFO_ITEM_TYPE_ENTRY
==
p_vcdplayer
->
play_item
.
type
)
;
}
p_buf
+=
M2F2_SECTOR_SIZE
;
/* Update seekpoint */
if
(
VCDINFO_ITEM_TYPE_ENTRY
==
p_vcdplayer
->
play_item
.
type
)
{
size_t
i_entry
=
p_vcdplayer
->
play_item
.
num
+
1
;
lsn_t
i_lsn
=
vcdinfo_get_entry_lsn
(
p_vcdplayer
->
vcd
,
i_entry
);
if
(
p_vcdplayer
->
i_lsn
>=
i_lsn
&&
i_lsn
!=
VCDINFO_NULL_LSN
)
{
{
dbg_print
(
(
INPUT_DBG_LSN
|
INPUT_DBG_PBC
),
size_t
i_entry
=
p_vcdplayer
->
play_item
.
num
+
1
;
"entry change to %d, current LSN %u >= end %u"
,
lsn_t
i_lsn
=
vcdinfo_get_entry_lsn
(
p_vcdplayer
->
vcd
,
i_entry
);
i_entry
,
p_vcdplayer
->
i_lsn
,
i_lsn
);
if
(
p_vcdplayer
->
i_lsn
>=
i_lsn
&&
i_lsn
!=
VCDINFO_NULL_LSN
)
{
dbg_print
(
(
INPUT_DBG_LSN
|
INPUT_DBG_PBC
),
"entry change to %d, current LSN %u >= end %u"
,
i_entry
,
p_vcdplayer
->
i_lsn
,
i_lsn
);
p_vcdplayer
->
play_item
.
num
=
i_entry
;
p_vcdplayer
->
play_item
.
num
=
i_entry
;
VCDSetOrigin
(
p_access
,
i_lsn
,
p_vcdplayer
->
i_track
,
VCDSetOrigin
(
p_access
,
i_lsn
,
p_vcdplayer
->
i_track
,
&
(
p_vcdplayer
->
play_item
)
);
&
(
p_vcdplayer
->
play_item
)
);
}
}
}
}
}
}
return
p_block
;
return
p_block
;
...
@@ -249,74 +244,73 @@ int
...
@@ -249,74 +244,73 @@ int
VCDSeek
(
access_t
*
p_access
,
int64_t
i_pos
)
VCDSeek
(
access_t
*
p_access
,
int64_t
i_pos
)
{
{
if
(
!
p_access
||
!
p_access
->
p_sys
)
return
VLC_EGENERIC
;
if
(
!
p_access
||
!
p_access
->
p_sys
)
return
VLC_EGENERIC
;
{
{
vcdplayer_t
*
p_vcdplayer
=
(
vcdplayer_t
*
)
p_vcd_access
->
p_sys
;
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
];
const
input_title_t
*
t
=
p_vcdplayer
->
p_title
[
p_access
->
info
.
i_title
];
unsigned
int
i_entry
=
VCDINFO_INVALID_ENTRY
;
unsigned
int
i_entry
=
VCDINFO_INVALID_ENTRY
;
int
i_seekpoint
;
int
i_seekpoint
;
/* Next sector to read */
/* Next sector to read */
p_access
->
info
.
i_pos
=
i_pos
;
p_access
->
info
.
i_pos
=
i_pos
;
p_vcdplayer
->
i_lsn
=
(
i_pos
/
(
int64_t
)
M2F2_SECTOR_SIZE
)
+
p_vcdplayer
->
i_lsn
=
(
i_pos
/
(
int64_t
)
M2F2_SECTOR_SIZE
)
+
p_vcdplayer
->
origin_lsn
;
p_vcdplayer
->
origin_lsn
;
switch
(
p_vcdplayer
->
play_item
.
type
)
{
switch
(
p_vcdplayer
->
play_item
.
type
)
case
VCDINFO_ITEM_TYPE_TRACK
:
{
case
VCDINFO_ITEM_TYPE_ENTRY
:
case
VCDINFO_ITEM_TYPE_TRACK
:
break
;
case
VCDINFO_ITEM_TYPE_ENTRY
:
default:
break
;
p_vcdplayer
->
b_valid_ep
=
false
;
default:
}
p_vcdplayer
->
b_valid_ep
=
false
;
break
;
/* Find entry */
if
(
p_vcdplayer
->
b_valid_ep
)
{
for
(
i_entry
=
0
;
i_entry
<
p_vcdplayer
->
i_entries
;
i_entry
++
)
{
if
(
p_vcdplayer
->
i_lsn
<
p_vcdplayer
->
p_entries
[
i_entry
]
)
{
VCDUpdateVar
(
p_access
,
i_entry
,
VLC_VAR_SETVALUE
,
"chapter"
,
_
(
"Entry"
),
"Setting entry"
);
break
;
}
}
{
vcdinfo_itemid_t
itemid
;
itemid
.
num
=
i_entry
;
itemid
.
type
=
VCDINFO_ITEM_TYPE_ENTRY
;
VCDSetOrigin
(
p_access
,
p_vcdplayer
->
i_lsn
,
p_vcdplayer
->
i_track
,
&
itemid
);
}
}
}
dbg_print
(
(
INPUT_DBG_CALL
|
INPUT_DBG_EXT
|
INPUT_DBG_SEEK
),
/* Find entry */
"orig %lu, cur: %lu, offset: %lld, entry %d"
,
if
(
p_vcdplayer
->
b_valid_ep
)
(
long
unsigned
int
)
p_vcdplayer
->
origin_lsn
,
{
(
long
unsigned
int
)
p_vcdplayer
->
i_lsn
,
i_pos
,
for
(
i_entry
=
0
;
i_entry
<
p_vcdplayer
->
i_entries
;
i_entry
++
)
i_entry
);
{
if
(
p_vcdplayer
->
i_lsn
<
p_vcdplayer
->
p_entries
[
i_entry
]
)
{
VCDUpdateVar
(
p_access
,
i_entry
,
VLC_VAR_SETVALUE
,
"chapter"
,
_
(
"Entry"
),
"Setting entry"
);
break
;
}
}
{
vcdinfo_itemid_t
itemid
;
itemid
.
num
=
i_entry
;
itemid
.
type
=
VCDINFO_ITEM_TYPE_ENTRY
;
VCDSetOrigin
(
p_access
,
p_vcdplayer
->
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_vcdplayer
->
origin_lsn
,
(
long
unsigned
int
)
p_vcdplayer
->
i_lsn
,
i_pos
,
i_entry
);
/* Find seekpoint */
/* Find seekpoint */
for
(
i_seekpoint
=
0
;
i_seekpoint
<
t
->
i_seekpoint
;
i_seekpoint
++
)
for
(
i_seekpoint
=
0
;
i_seekpoint
<
t
->
i_seekpoint
;
i_seekpoint
++
)
{
{
if
(
i_seekpoint
+
1
>=
t
->
i_seekpoint
)
break
;
if
(
i_seekpoint
+
1
>=
t
->
i_seekpoint
)
break
;
if
(
i_pos
<
t
->
seekpoint
[
i_seekpoint
+
1
]
->
i_byte_offset
)
break
;
if
(
i_pos
<
t
->
seekpoint
[
i_seekpoint
+
1
]
->
i_byte_offset
)
break
;
}
}
/* Update current seekpoint */
/* Update current seekpoint */
if
(
i_seekpoint
!=
p_access
->
info
.
i_seekpoint
)
if
(
i_seekpoint
!=
p_access
->
info
.
i_seekpoint
)
{
{
dbg_print
(
(
INPUT_DBG_SEEK
),
"seekpoint change %lu"
,
dbg_print
(
(
INPUT_DBG_SEEK
),
"seekpoint change %lu"
,
(
long
unsigned
int
)
i_seekpoint
);
(
long
unsigned
int
)
i_seekpoint
);
p_access
->
info
.
i_update
|=
INPUT_UPDATE_SEEKPOINT
;
p_access
->
info
.
i_update
|=
INPUT_UPDATE_SEEKPOINT
;
p_access
->
info
.
i_seekpoint
=
i_seekpoint
;
p_access
->
info
.
i_seekpoint
=
i_seekpoint
;
}
}
}
}
p_access
->
info
.
b_eof
=
false
;
p_access
->
info
.
b_eof
=
false
;
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -327,61 +321,59 @@ VCDSeek( access_t * p_access, int64_t i_pos )
...
@@ -327,61 +321,59 @@ VCDSeek( access_t * p_access, int64_t i_pos )
static
bool
static
bool
VCDEntryPoints
(
access_t
*
p_access
)
VCDEntryPoints
(
access_t
*
p_access
)
{
{
if
(
!
p_access
||
!
p_access
->
p_sys
)
return
false
;
if
(
!
p_access
||
!
p_access
->
p_sys
)
return
false
;
{
vcdplayer_t
*
p_vcdplayer
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdplayer_t
*
p_vcdplayer
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
const
unsigned
int
i_entries
=
const
unsigned
int
i_entries
=
vcdinfo_get_num_entries
(
p_vcdplayer
->
vcd
);
vcdinfo_get_num_entries
(
p_vcdplayer
->
vcd
);
const
track_t
i_last_track
const
track_t
i_last_track
=
cdio_get_num_tracks
(
vcdinfo_get_cd_image
(
p_vcdplayer
->
vcd
))
=
cdio_get_num_tracks
(
vcdinfo_get_cd_image
(
p_vcdplayer
->
vcd
))
+
cdio_get_first_track_num
(
vcdinfo_get_cd_image
(
p_vcdplayer
->
vcd
));
+
cdio_get_first_track_num
(
vcdinfo_get_cd_image
(
p_vcdplayer
->
vcd
));
unsigned
int
i
;
unsigned
int
i
;
if
(
0
==
i_entries
)
{
if
(
0
==
i_entries
)
{
LOG_ERR
(
"no entires found -- something is wrong"
);
LOG_ERR
(
"no entires found -- something is wrong"
);
return
false
;
return
false
;
}
}
p_vcdplayer
->
p_entries
=
malloc
(
sizeof
(
lsn_t
)
*
i_entries
);
p_vcdplayer
->
p_entries
=
malloc
(
sizeof
(
lsn_t
)
*
i_entries
);
if
(
p_vcdplayer
->
p_entries
==
NULL
)
if
(
p_vcdplayer
->
p_entries
==
NULL
)
{
{
LOG_ERR
(
"not enough memory for entry points treatment"
);
LOG_ERR
(
"not enough memory for entry points treatment"
);
return
false
;
return
false
;
}
}
p_vcdplayer
->
i_entries
=
i_entries
;
p_vcdplayer
->
i_entries
=
i_entries
;
for
(
i
=
0
;
i
<
i_entries
;
i
++
)
for
(
i
=
0
;
i
<
i_entries
;
i
++
)
{
{
const
track_t
i_track
=
vcdinfo_get_track
(
p_vcdplayer
->
vcd
,
i
);
const
track_t
i_track
=
vcdinfo_get_track
(
p_vcdplayer
->
vcd
,
i
);
if
(
i_track
<=
i_last_track
)
{
if
(
i_track
<=
i_last_track
)
seekpoint_t
*
s
=
vlc_seekpoint_New
();
{
char
psz_entry
[
100
];
seekpoint_t
*
s
=
vlc_seekpoint_New
();
char
psz_entry
[
100
];
snprintf
(
psz_entry
,
sizeof
(
psz_entry
),
"%s %02d"
,
_
(
"Entry"
),
i
);
snprintf
(
psz_entry
,
sizeof
(
psz_entry
),
"%s %02d"
,
_
(
"Entry"
),
i
);
p_vcdplayer
->
p_entries
[
i
]
=
vcdinfo_get_entry_lsn
(
p_vcdplayer
->
vcd
,
i
);
p_vcdplayer
->
p_entries
[
i
]
=
vcdinfo_get_entry_lsn
(
p_vcdplayer
->
vcd
,
i
);
s
->
psz_name
=
strdup
(
psz_entry
);
s
->
psz_name
=
strdup
(
psz_entry
);
s
->
i_byte_offset
=
s
->
i_byte_offset
=
(
p_vcdplayer
->
p_entries
[
i
]
(
p_vcdplayer
->
p_entries
[
i
]
-
vcdinfo_get_track_lsn
(
p_vcdplayer
->
vcd
,
i_track
))
-
vcdinfo_get_track_lsn
(
p_vcdplayer
->
vcd
,
i_track
))
*
M2F2_SECTOR_SIZE
;
*
M2F2_SECTOR_SIZE
;
dbg_print
(
INPUT_DBG_MRL
,
dbg_print
(
INPUT_DBG_MRL
,
"%s, lsn %d, byte_offset %ld"
,
"%s, lsn %d, byte_offset %ld"
,
s
->
psz_name
,
p_vcdplayer
->
p_entries
[
i
],
s
->
psz_name
,
p_vcdplayer
->
p_entries
[
i
],
(
unsigned
long
int
)
s
->
i_byte_offset
);
(
unsigned
long
int
)
s
->
i_byte_offset
);
TAB_APPEND
(
p_vcdplayer
->
p_title
[
i_track
-
1
]
->
i_seekpoint
,
TAB_APPEND
(
p_vcdplayer
->
p_title
[
i_track
-
1
]
->
i_seekpoint
,
p_vcdplayer
->
p_title
[
i_track
-
1
]
->
seekpoint
,
s
);
p_vcdplayer
->
p_title
[
i_track
-
1
]
->
seekpoint
,
s
);
}
else
}
else
msg_Warn
(
p_access
,
"wrong track number found in entry points"
);
msg_Warn
(
p_access
,
"wrong track number found in entry points"
);
}
}
p_vcdplayer
->
b_valid_ep
=
true
;
p_vcdplayer
->
b_valid_ep
=
true
;
return
true
;
return
true
;
}
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -410,8 +402,7 @@ VCDSegments( access_t * p_access )
...
@@ -410,8 +402,7 @@ VCDSegments( access_t * p_access )
/* We have one additional segment allocated so we can get the size
/* We have one additional segment allocated so we can get the size
by subtracting seg[i+1] - seg[i].
by subtracting seg[i+1] - seg[i].
*/
*/
p_vcdplayer
->
p_segments
=
p_vcdplayer
->
p_segments
=
malloc
(
sizeof
(
lsn_t
)
*
(
p_vcdplayer
->
i_segments
+
1
));
malloc
(
sizeof
(
lsn_t
)
*
(
p_vcdplayer
->
i_segments
+
1
)
);
if
(
p_vcdplayer
->
p_segments
==
NULL
)
if
(
p_vcdplayer
->
p_segments
==
NULL
)
{
{
LOG_ERR
(
"not enough memory for segment treatment"
);
LOG_ERR
(
"not enough memory for segment treatment"
);
...
@@ -594,69 +585,70 @@ VCDParse( access_t * p_access, /*out*/ vcdinfo_itemid_t * p_itemid,
...
@@ -594,69 +585,70 @@ VCDParse( access_t * p_access, /*out*/ vcdinfo_itemid_t * p_itemid,
type+entry number. */
type+entry number. */
unsigned
int
num
;
unsigned
int
num
;
*
psz_parser
=
'\0'
;
*
psz_parser
=
'\0'
;
++
psz_parser
;
++
psz_parser
;
if
(
*
psz_parser
)
if
(
*
psz_parser
)
{
switch
(
*
psz_parser
)
{
switch
(
*
psz_parser
)
{
case
'E'
:
case
'E'
:
p_itemid
->
type
=
VCDINFO_ITEM_TYPE_ENTRY
;
p_itemid
->
type
=
VCDINFO_ITEM_TYPE_ENTRY
;
++
psz_parser
;
++
psz_parser
;
*
play_single_item
=
true
;
*
play_single_item
=
true
;
break
;
break
;
case
'P'
:
case
'P'
:
p_itemid
->
type
=
VCDINFO_ITEM_TYPE_LID
;
p_itemid
->
type
=
VCDINFO_ITEM_TYPE_LID
;
++
psz_parser
;
++
psz_parser
;
*
play_single_item
=
false
;
*
play_single_item
=
false
;
break
;
break
;
case
'S'
:
case
'S'
:
p_itemid
->
type
=
VCDINFO_ITEM_TYPE_SEGMENT
;
p_itemid
->
type
=
VCDINFO_ITEM_TYPE_SEGMENT
;
++
psz_parser
;
++
psz_parser
;
*
play_single_item
=
true
;
*
play_single_item
=
true
;
break
;
break
;
case
'T'
:
case
'T'
:
p_itemid
->
type
=
VCDINFO_ITEM_TYPE_TRACK
;
p_itemid
->
type
=
VCDINFO_ITEM_TYPE_TRACK
;
++
psz_parser
;
++
psz_parser
;
*
play_single_item
=
true
;
*
play_single_item
=
true
;
break
;
break
;
default:
;
default:
}
break
;
}
}
num
=
strtol
(
psz_parser
,
&
psz_next
,
10
);
num
=
strtol
(
psz_parser
,
&
psz_next
,
10
);
if
(
*
psz_parser
!=
'\0'
&&
*
psz_next
==
'\0'
)
if
(
*
psz_parser
!=
'\0'
&&
*
psz_next
==
'\0'
)
{
{
p_itemid
->
num
=
num
;
p_itemid
->
num
=
num
;
}
}
}
else
{
}
else
{
*
play_single_item
=
(
VCDINFO_ITEM_TYPE_LID
==
p_itemid
->
type
);
*
play_single_item
=
(
VCDINFO_ITEM_TYPE_LID
==
p_itemid
->
type
);
}
}
if
(
!*
psz_source
)
{
if
(
!*
psz_source
)
{
/* No source specified, so figure it out. */
/* No source specified, so figure it out. */
if
(
!
p_access
->
psz_access
)
return
NULL
;
if
(
!
p_access
->
psz_access
)
return
NULL
;
psz_source
=
config_GetPsz
(
p_access
,
"vcd"
);
psz_source
=
config_GetPsz
(
p_access
,
"vcd"
);
if
(
!
psz_source
||
0
==
strlen
(
psz_source
)
)
{
if
(
!
psz_source
||
0
==
strlen
(
psz_source
)
)
free
(
psz_source
);
/* Scan for a CD-ROM drive with a VCD in it. */
char
**
cd_drives
=
cdio_get_devices_with_cap
(
NULL
,
(
CDIO_FS_ANAL_SVCD
|
CDIO_FS_ANAL_CVD
|
CDIO_FS_ANAL_VIDEOCD
|
CDIO_FS_UNKNOWN
),
true
);
if
(
NULL
==
cd_drives
)
return
NULL
;
if
(
cd_drives
[
0
]
==
NULL
)
{
{
cdio_free_device_list
(
cd_drives
);
free
(
psz_source
);
return
NULL
;
/* Scan for a CD-ROM drive with a VCD in it. */
char
**
cd_drives
=
cdio_get_devices_with_cap
(
NULL
,
(
CDIO_FS_ANAL_SVCD
|
CDIO_FS_ANAL_CVD
|
CDIO_FS_ANAL_VIDEOCD
|
CDIO_FS_UNKNOWN
),
true
);
if
(
NULL
==
cd_drives
)
return
NULL
;
if
(
cd_drives
[
0
]
==
NULL
)
{
cdio_free_device_list
(
cd_drives
);
return
NULL
;
}
psz_source
=
strdup
(
cd_drives
[
0
]
);
cdio_free_device_list
(
cd_drives
);
}
}
psz_source
=
strdup
(
cd_drives
[
0
]
);
cdio_free_device_list
(
cd_drives
);
}
}
}
dbg_print
(
(
INPUT_DBG_CALL
|
INPUT_DBG_MRL
),
dbg_print
(
(
INPUT_DBG_CALL
|
INPUT_DBG_MRL
),
...
@@ -673,65 +665,65 @@ void
...
@@ -673,65 +665,65 @@ void
VCDSetOrigin
(
access_t
*
p_access
,
lsn_t
i_lsn
,
track_t
i_track
,
VCDSetOrigin
(
access_t
*
p_access
,
lsn_t
i_lsn
,
track_t
i_track
,
const
vcdinfo_itemid_t
*
p_itemid
)
const
vcdinfo_itemid_t
*
p_itemid
)
{
{
vcdplayer_t
*
p_vcdplayer
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
vcdplayer_t
*
p_vcdplayer
=
(
vcdplayer_t
*
)
p_access
->
p_sys
;
dbg_print
(
(
INPUT_DBG_CALL
|
INPUT_DBG_LSN
),
dbg_print
(
(
INPUT_DBG_CALL
|
INPUT_DBG_LSN
),
"i_lsn: %lu, track: %d"
,
(
long
unsigned
int
)
i_lsn
,
"i_lsn: %lu, track: %d"
,
(
long
unsigned
int
)
i_lsn
,
i_track
);
i_track
);
vcdplayer_set_origin
(
p_access
,
i_lsn
,
i_track
,
p_itemid
);
vcdplayer_set_origin
(
p_access
,
i_lsn
,
i_track
,
p_itemid
);
switch
(
p_vcdplayer
->
play_item
.
type
)
switch
(
p_vcdplayer
->
play_item
.
type
)
{
{
case
VCDINFO_ITEM_TYPE_ENTRY
:
case
VCDINFO_ITEM_TYPE_ENTRY
:
VCDUpdateVar
(
p_access
,
p_itemid
->
num
,
VLC_VAR_SETVALUE
,
VCDUpdateVar
(
p_access
,
p_itemid
->
num
,
VLC_VAR_SETVALUE
,
"chapter"
,
_
(
"Entry"
),
"Setting entry/segment"
);
"chapter"
,
_
(
"Entry"
),
"Setting entry/segment"
);
p_access
->
info
.
i_title
=
i_track
-
1
;
p_access
->
info
.
i_title
=
i_track
-
1
;
if
(
p_vcdplayer
->
b_track_length
)
if
(
p_vcdplayer
->
b_track_length
)
{
{
p_access
->
info
.
i_size
=
p_vcdplayer
->
p_title
[
i_track
-
1
]
->
i_size
;
p_access
->
info
.
i_size
=
p_vcdplayer
->
p_title
[
i_track
-
1
]
->
i_size
;
p_access
->
info
.
i_pos
=
(
int64_t
)
M2F2_SECTOR_SIZE
*
p_access
->
info
.
i_pos
=
(
int64_t
)
M2F2_SECTOR_SIZE
*
(
vcdinfo_get_track_lsn
(
p_vcdplayer
->
vcd
,
i_track
)
-
i_lsn
);
(
vcdinfo_get_track_lsn
(
p_vcdplayer
->
vcd
,
i_track
)
-
i_lsn
);
}
else
{
}
else
{
p_access
->
info
.
i_size
=
M2F2_SECTOR_SIZE
*
(
int64_t
)
p_access
->
info
.
i_size
=
M2F2_SECTOR_SIZE
*
(
int64_t
)
vcdinfo_get_entry_sect_count
(
p_vcdplayer
->
vcd
,
p_itemid
->
num
);
vcdinfo_get_entry_sect_count
(
p_vcdplayer
->
vcd
,
p_itemid
->
num
);
p_access
->
info
.
i_pos
=
0
;
p_access
->
info
.
i_pos
=
0
;
}
}
dbg_print
(
(
INPUT_DBG_LSN
|
INPUT_DBG_PBC
),
"size: %llu, pos: %llu"
,
dbg_print
(
(
INPUT_DBG_LSN
|
INPUT_DBG_PBC
),
"size: %llu, pos: %llu"
,
p_access
->
info
.
i_size
,
p_access
->
info
.
i_pos
);
p_access
->
info
.
i_size
,
p_access
->
info
.
i_pos
);
p_access
->
info
.
i_seekpoint
=
p_itemid
->
num
;
p_access
->
info
.
i_seekpoint
=
p_itemid
->
num
;
break
;
break
;
case
VCDINFO_ITEM_TYPE_SEGMENT
:
case
VCDINFO_ITEM_TYPE_SEGMENT
:
VCDUpdateVar
(
p_access
,
p_itemid
->
num
,
VLC_VAR_SETVALUE
,
VCDUpdateVar
(
p_access
,
p_itemid
->
num
,
VLC_VAR_SETVALUE
,
"chapter"
,
_
(
"Segment"
),
"Setting entry/segment"
);
"chapter"
,
_
(
"Segment"
),
"Setting entry/segment"
);
/* The last title entry is the for segments (when segments exist
/* The last title entry is the for segments (when segments exist
and they must here. The segment seekpoints are stored after
and they must here. The segment seekpoints are stored after
the entry seekpoints and (zeroed) lid seekpoints.
the entry seekpoints and (zeroed) lid seekpoints.
*/
*/
p_access
->
info
.
i_title
=
p_vcdplayer
->
i_titles
-
1
;
p_access
->
info
.
i_title
=
p_vcdplayer
->
i_titles
-
1
;
p_access
->
info
.
i_size
=
0
;
/* No seeking on stills, please. */
p_access
->
info
.
i_size
=
0
;
/* No seeking on stills, please. */
p_access
->
info
.
i_pos
=
0
;
p_access
->
info
.
i_pos
=
0
;
p_access
->
info
.
i_seekpoint
=
p_vcdplayer
->
i_entries
p_access
->
info
.
i_seekpoint
=
p_vcdplayer
->
i_entries
+
p_vcdplayer
->
i_lids
+
p_itemid
->
num
;
+
p_vcdplayer
->
i_lids
+
p_itemid
->
num
;
break
;
break
;
case
VCDINFO_ITEM_TYPE_TRACK
:
case
VCDINFO_ITEM_TYPE_TRACK
:
p_access
->
info
.
i_title
=
i_track
-
1
;
p_access
->
info
.
i_title
=
i_track
-
1
;
p_access
->
info
.
i_size
=
p_vcdplayer
->
p_title
[
i_track
-
1
]
->
i_size
;
p_access
->
info
.
i_size
=
p_vcdplayer
->
p_title
[
i_track
-
1
]
->
i_size
;
p_access
->
info
.
i_pos
=
0
;
p_access
->
info
.
i_pos
=
0
;
p_access
->
info
.
i_seekpoint
=
vcdinfo_track_get_entry
(
p_vcdplayer
->
vcd
,
p_access
->
info
.
i_seekpoint
=
vcdinfo_track_get_entry
(
p_vcdplayer
->
vcd
,
i_track
);
i_track
);
break
;
break
;
default:
default:
msg_Warn
(
p_access
,
"can't set origin for play type %d"
,
msg_Warn
(
p_access
,
"can't set origin for play type %d"
,
p_vcdplayer
->
play_item
.
type
);
p_vcdplayer
->
play_item
.
type
);
}
}
p_access
->
info
.
i_update
=
INPUT_UPDATE_TITLE
|
INPUT_UPDATE_SIZE
p_access
->
info
.
i_update
=
INPUT_UPDATE_TITLE
|
INPUT_UPDATE_SIZE
|
INPUT_UPDATE_SEEKPOINT
;
|
INPUT_UPDATE_SEEKPOINT
;
VCDUpdateTitle
(
p_access
);
VCDUpdateTitle
(
p_access
);
}
}
...
@@ -753,10 +745,11 @@ vcd_Open( vlc_object_t *p_this, const char *psz_dev )
...
@@ -753,10 +745,11 @@ vcd_Open( vlc_object_t *p_this, const char *psz_dev )
if
(
!
psz_dev
)
return
NULL
;
if
(
!
psz_dev
)
return
NULL
;
actual_dev
=
ToLocaleDup
(
psz_dev
);
actual_dev
=
ToLocaleDup
(
psz_dev
);
if
(
vcdinfo_open
(
&
p_vcdobj
,
&
actual_dev
,
DRIVER_UNKNOWN
,
NULL
)
!=
if
(
vcdinfo_open
(
&
p_vcdobj
,
&
actual_dev
,
DRIVER_UNKNOWN
,
NULL
)
!=
VCDINFO_OPEN_VCD
)
{
VCDINFO_OPEN_VCD
)
free
(
actual_dev
);
{
return
NULL
;
free
(
actual_dev
);
return
NULL
;
}
}
free
(
actual_dev
);
free
(
actual_dev
);
...
@@ -764,41 +757,49 @@ vcd_Open( vlc_object_t *p_this, const char *psz_dev )
...
@@ -764,41 +757,49 @@ vcd_Open( vlc_object_t *p_this, const char *psz_dev )
Save summary info on tracks, segments and entries...
Save summary info on tracks, segments and entries...
*/
*/
if
(
0
<
(
p_vcdplayer
->
i_tracks
=
vcdinfo_get_num_tracks
(
p_vcdobj
))
)
{
if
(
0
<
(
p_vcdplayer
->
i_tracks
=
vcdinfo_get_num_tracks
(
p_vcdobj
))
)
p_vcdplayer
->
track
=
(
vcdplayer_play_item_info_t
*
)
{
calloc
(
p_vcdplayer
->
i_tracks
,
sizeof
(
vcdplayer_play_item_info_t
));
p_vcdplayer
->
track
=
(
vcdplayer_play_item_info_t
*
)
calloc
(
p_vcdplayer
->
i_tracks
,
sizeof
(
vcdplayer_play_item_info_t
));
for
(
i
=
0
;
i
<
p_vcdplayer
->
i_tracks
;
i
++
)
{
unsigned
int
track_num
=
i
+
1
;
for
(
i
=
0
;
i
<
p_vcdplayer
->
i_tracks
;
i
++
)
p_vcdplayer
->
track
[
i
].
size
=
{
vcdinfo_get_track_sect_count
(
p_vcdobj
,
track_num
);
unsigned
int
track_num
=
i
+
1
;
p_vcdplayer
->
track
[
i
].
start_LSN
=
p_vcdplayer
->
track
[
i
].
size
=
vcdinfo_get_track_lsn
(
p_vcdobj
,
track_num
);
vcdinfo_get_track_sect_count
(
p_vcdobj
,
track_num
);
}
p_vcdplayer
->
track
[
i
].
start_LSN
=
vcdinfo_get_track_lsn
(
p_vcdobj
,
track_num
);
}
}
else
}
else
p_vcdplayer
->
track
=
NULL
;
p_vcdplayer
->
track
=
NULL
;
if
(
0
<
(
p_vcdplayer
->
i_entries
=
vcdinfo_get_num_entries
(
p_vcdobj
))
)
{
if
(
0
<
(
p_vcdplayer
->
i_entries
=
vcdinfo_get_num_entries
(
p_vcdobj
))
)
p_vcdplayer
->
entry
=
(
vcdplayer_play_item_info_t
*
)
{
calloc
(
p_vcdplayer
->
i_entries
,
sizeof
(
vcdplayer_play_item_info_t
));
p_vcdplayer
->
entry
=
(
vcdplayer_play_item_info_t
*
)
calloc
(
p_vcdplayer
->
i_entries
,
sizeof
(
vcdplayer_play_item_info_t
));
for
(
i
=
0
;
i
<
p_vcdplayer
->
i_entries
;
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
].
size
=
p_vcdplayer
->
entry
[
i
].
start_LSN
=
vcdinfo_get_entry_lsn
(
p_vcdobj
,
i
);
vcdinfo_get_entry_sect_count
(
p_vcdobj
,
i
);
}
p_vcdplayer
->
entry
[
i
].
start_LSN
=
vcdinfo_get_entry_lsn
(
p_vcdobj
,
i
);
}
}
else
}
else
p_vcdplayer
->
entry
=
NULL
;
p_vcdplayer
->
entry
=
NULL
;
if
(
0
<
(
p_vcdplayer
->
i_segments
=
vcdinfo_get_num_segments
(
p_vcdobj
))
)
{
if
(
0
<
(
p_vcdplayer
->
i_segments
=
vcdinfo_get_num_segments
(
p_vcdobj
))
)
p_vcdplayer
->
segment
=
(
vcdplayer_play_item_info_t
*
)
{
calloc
(
p_vcdplayer
->
i_segments
,
sizeof
(
vcdplayer_play_item_info_t
));
p_vcdplayer
->
segment
=
(
vcdplayer_play_item_info_t
*
)
calloc
(
p_vcdplayer
->
i_segments
,
sizeof
(
vcdplayer_play_item_info_t
));
for
(
i
=
0
;
i
<
p_vcdplayer
->
i_segments
;
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
].
size
=
p_vcdplayer
->
segment
[
i
].
start_LSN
=
vcdinfo_get_seg_lsn
(
p_vcdobj
,
i
);
vcdinfo_get_seg_sector_count
(
p_vcdobj
,
i
);
}
p_vcdplayer
->
segment
[
i
].
start_LSN
=
vcdinfo_get_seg_lsn
(
p_vcdobj
,
i
);
}
}
else
}
else
p_vcdplayer
->
segment
=
NULL
;
p_vcdplayer
->
segment
=
NULL
;
...
@@ -813,18 +814,20 @@ VCDUpdateVar( access_t *p_access, int i_num, int i_action,
...
@@ -813,18 +814,20 @@ VCDUpdateVar( access_t *p_access, int i_num, int i_action,
const
char
*
p_varname
,
char
*
p_label
,
const
char
*
p_varname
,
char
*
p_label
,
const
char
*
p_debug_label
)
const
char
*
p_debug_label
)
{
{
vlc_value_t
val
;
vlc_value_t
val
;
val
.
i_int
=
i_num
;
val
.
i_int
=
i_num
;
if
(
p_access
)
{
if
(
p_access
)
const
vcdplayer_t
*
p_vcdplayer
=
(
vcdplayer_t
*
)
p_vcd_access
->
p_sys
;
{
dbg_print
(
INPUT_DBG_PBC
,
"%s %d"
,
p_debug_label
,
i_num
);
const
vcdplayer_t
*
p_vcdplayer
=
(
vcdplayer_t
*
)
p_vcd_access
->
p_sys
;
}
dbg_print
(
INPUT_DBG_PBC
,
"%s %d"
,
p_debug_label
,
i_num
);
if
(
p_label
)
{
}
vlc_value_t
text
;
if
(
p_label
)
text
.
psz_string
=
p_label
;
{
var_Change
(
p_access
,
p_varname
,
VLC_VAR_SETTEXT
,
&
text
,
NULL
);
vlc_value_t
text
;
}
text
.
psz_string
=
p_label
;
var_Change
(
p_access
,
p_varname
,
i_action
,
&
val
,
NULL
);
var_Change
(
p_access
,
p_varname
,
VLC_VAR_SETTEXT
,
&
text
,
NULL
);
}
var_Change
(
p_access
,
p_varname
,
i_action
,
&
val
,
NULL
);
}
}
...
@@ -879,8 +882,8 @@ VCDOpen ( vlc_object_t *p_this )
...
@@ -879,8 +882,8 @@ VCDOpen ( vlc_object_t *p_this )
if
(
NULL
==
psz_source
)
if
(
NULL
==
psz_source
)
{
{
free
(
p_vcdplayer
);
free
(
p_vcdplayer
);
return
(
VLC_EGENERIC
);
return
(
VLC_EGENERIC
);
}
}
dbg_print
(
(
INPUT_DBG_CALL
|
INPUT_DBG_EXT
),
"source: %s: mrl: %s"
,
dbg_print
(
(
INPUT_DBG_CALL
|
INPUT_DBG_EXT
),
"source: %s: mrl: %s"
,
...
@@ -912,7 +915,8 @@ VCDOpen ( vlc_object_t *p_this )
...
@@ -912,7 +915,8 @@ VCDOpen ( vlc_object_t *p_this )
/* Get track information. */
/* Get track information. */
p_vcdplayer
->
i_tracks
=
vcdinfo_get_num_tracks
(
p_vcdplayer
->
vcd
);
p_vcdplayer
->
i_tracks
=
vcdinfo_get_num_tracks
(
p_vcdplayer
->
vcd
);
if
(
p_vcdplayer
->
i_tracks
<
1
||
CDIO_INVALID_TRACK
==
p_vcdplayer
->
i_tracks
)
{
if
(
p_vcdplayer
->
i_tracks
<
1
||
CDIO_INVALID_TRACK
==
p_vcdplayer
->
i_tracks
)
{
vcdinfo_close
(
p_vcdplayer
->
vcd
);
vcdinfo_close
(
p_vcdplayer
->
vcd
);
LOG_ERR
(
"no movie tracks found"
);
LOG_ERR
(
"no movie tracks found"
);
goto
err_exit
;
goto
err_exit
;
...
@@ -950,9 +954,8 @@ VCDOpen ( vlc_object_t *p_this )
...
@@ -950,9 +954,8 @@ VCDOpen ( vlc_object_t *p_this )
p_access
->
psz_demux
=
strdup
(
"ps"
);
p_access
->
psz_demux
=
strdup
(
"ps"
);
#ifdef FIXED
#ifdef FIXED
if
(
play_single_item
)
if
(
play_single_item
)
VCDFixupPlayList
(
p_access
,
p_vcd
,
psz_source
,
&
itemid
,
VCDFixupPlayList
(
p_access
,
p_vcd
,
psz_source
,
&
itemid
,
play_single_item
);
play_single_item
);
#endif
#endif
#ifdef FIXED
#ifdef FIXED
...
@@ -984,10 +987,10 @@ VCDClose ( vlc_object_t *p_this )
...
@@ -984,10 +987,10 @@ VCDClose ( vlc_object_t *p_this )
dbg_print
(
(
INPUT_DBG_CALL
|
INPUT_DBG_EXT
),
"VCDClose"
);
dbg_print
(
(
INPUT_DBG_CALL
|
INPUT_DBG_EXT
),
"VCDClose"
);
{
{
unsigned
int
i
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
p_vcdplayer
->
i_titles
;
i
++
)
for
(
i
=
0
;
i
<
p_vcdplayer
->
i_titles
;
i
++
)
if
(
p_vcdplayer
->
p_title
[
i
])
if
(
p_vcdplayer
->
p_title
[
i
])
free
(
p_vcdplayer
->
p_title
[
i
]
->
psz_name
);
free
(
p_vcdplayer
->
p_title
[
i
]
->
psz_name
);
}
}
vcdinfo_close
(
p_vcdplayer
->
vcd
);
vcdinfo_close
(
p_vcdplayer
->
vcd
);
...
@@ -1024,186 +1027,167 @@ static int VCDControl( access_t *p_access, int i_query, va_list args )
...
@@ -1024,186 +1027,167 @@ static int VCDControl( access_t *p_access, int i_query, va_list args )
/* Pass back a copy of meta information that was gathered when we
/* Pass back a copy of meta information that was gathered when we
during the Open/Initialize call.
during the Open/Initialize call.
*/
*/
case
ACCESS_GET_META
:
case
ACCESS_GET_META
:
{
dbg_print
(
INPUT_DBG_EVENT
,
"get meta info"
);
dbg_print
(
INPUT_DBG_EVENT
,
"get meta info"
);
#if 0
#if 0
if( p_vcdplayer->p_meta )
if( p_vcdplayer->p_meta )
{
{
vlc_meta_t **pp_meta = (vlc_meta_t**)va_arg(args,vlc_meta_t**);
vlc_meta_t **pp_meta = (vlc_meta_t**)va_arg(args,vlc_meta_t**);
*pp_meta = vlc_meta_Duplicate( p_vcdplayer->p_meta );
*pp_meta = vlc_meta_Duplicate( p_vcdplayer->p_meta );
dbg_print( INPUT_DBG_META, "%s", "Meta copied" );
dbg_print( INPUT_DBG_META, "%s", "Meta copied" );
}
}
else
else
#endif
#endif
msg_Warn
(
p_access
,
"tried to copy NULL meta info"
);
msg_Warn
(
p_access
,
"tried to copy NULL meta info"
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
return
VLC_EGENERIC
;
case
ACCESS_CAN_SEEK
:
case
ACCESS_CAN_SEEK
:
case
ACCESS_CAN_FASTSEEK
:
case
ACCESS_CAN_FASTSEEK
:
case
ACCESS_CAN_PAUSE
:
case
ACCESS_CAN_PAUSE
:
case
ACCESS_CAN_CONTROL_PACE
:
case
ACCESS_CAN_CONTROL_PACE
:
{
bool
*
pb_bool
=
(
bool
*
)
va_arg
(
args
,
bool
*
);
dbg_print
(
INPUT_DBG_EVENT
,
dbg_print
(
INPUT_DBG_EVENT
,
"seek/fastseek/pause/can_control_pace"
);
"seek/fastseek/pause/can_control_pace"
);
*
pb_bool
=
true
;
*
((
bool
*
)
va_arg
(
args
,
bool
*
))
=
true
;
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
break
;
}
/* */
case
ACCESS_GET_PTS_DELAY
:
*
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
)
=
MILLISECONDS_PER_SEC
*
var_GetInteger
(
p_access
,
MODULE_STRING
"-caching"
);
dbg_print
(
INPUT_DBG_EVENT
,
"GET PTS DELAY"
);
return
VLC_SUCCESS
;
/* */
/* */
case
ACCESS_GET_PTS_DELAY
:
case
ACCESS_SET_PAUSE_STATE
:
dbg_print
(
INPUT_DBG_EVENT
,
"SET PAUSE STATE"
);
return
VLC_SUCCESS
;
case
ACCESS_GET_TITLE_INFO
:
{
unsigned
int
psz_mrl_max
=
strlen
(
VCD_MRL_PREFIX
)
+
strlen
(
p_vcdplayer
->
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
);
unsigned
int
i
;
pi_int
=
(
int
*
)
va_arg
(
args
,
int
*
);
dbg_print
(
INPUT_DBG_EVENT
,
"GET TITLE: i_titles %d"
,
p_vcdplayer
->
i_titles
);
if
(
psz_mrl
)
{
{
int64_t
*
pi_64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
snprintf
(
psz_mrl
,
psz_mrl_max
,
"%s%s"
,
*
pi_64
=
var_GetInteger
(
p_access
,
MODULE_STRING
"-caching"
)
VCD_MRL_PREFIX
,
p_vcdplayer
->
psz_source
);
*
MILLISECONDS_PER_SEC
;
VCDMetaInfo
(
p_access
,
psz_mrl
);
dbg_print
(
INPUT_DBG_EVENT
,
"GET PTS DELAY"
);
free
(
psz_mrl
);
return
VLC_SUCCESS
;
break
;
}
}
/* */
/* Duplicate title info */
case
ACCESS_SET_PAUSE_STATE
:
if
(
p_vcdplayer
->
i_titles
==
0
)
dbg_print
(
INPUT_DBG_EVENT
,
"SET PAUSE STATE"
);
{
*
pi_int
=
0
;
ppp_title
=
NULL
;
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
break
;
}
*
pi_int
=
p_vcdplayer
->
i_titles
;
*
ppp_title
=
malloc
(
sizeof
(
input_title_t
**
)
*
p_vcdplayer
->
i_titles
);
case
ACCESS_GET_TITLE_INFO
:
if
(
!*
ppp_title
)
return
VLC_ENOMEM
;
{
unsigned
int
psz_mrl_max
=
strlen
(
VCD_MRL_PREFIX
)
+
strlen
(
p_vcdplayer
->
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
);
unsigned
int
i
;
pi_int
=
(
int
*
)
va_arg
(
args
,
int
*
);
for
(
i
=
0
;
i
<
p_vcdplayer
->
i_titles
;
i
++
)
if
(
p_vcdplayer
->
p_title
[
i
]
)
(
*
ppp_title
)[
i
]
=
vlc_input_title_Duplicate
(
p_vcdplayer
->
p_title
[
i
]);
}
break
;
dbg_print
(
INPUT_DBG_EVENT
,
"GET TITLE: i_titles %d"
,
case
ACCESS_SET_TITLE
:
p_vcdplayer
->
i_titles
);
i
=
(
int
)
va_arg
(
args
,
int
);
if
(
psz_mrl
)
dbg_print
(
INPUT_DBG_EVENT
,
"set title %d"
,
i
);
{
if
(
i
!=
p_access
->
info
.
i_title
)
snprintf
(
psz_mrl
,
psz_mrl_max
,
"%s%s"
,
{
VCD_MRL_PREFIX
,
p_vcdplayer
->
psz_source
)
;
vcdinfo_itemid_t
itemid
;
VCDMetaInfo
(
p_access
,
psz_mrl
)
;
track_t
i_track
=
i
+
1
;
free
(
psz_mrl
);
unsigned
int
i_entry
=
}
vcdinfo_track_get_entry
(
p_vcdplayer
->
vcd
,
i_track
);
/* Duplicate title info */
if
(
i
<
p_vcdplayer
->
i_tracks
)
if
(
p_vcdplayer
->
i_titles
==
0
)
{
{
*
pi_int
=
0
;
ppp_title
=
NULL
;
/* FIXME! For now we are assuming titles are only
return
VLC_SUCCESS
;
tracks and that track == title+1 */
itemid
.
num
=
i_track
;
itemid
.
type
=
VCDINFO_ITEM_TYPE_TRACK
;
}
}
*
pi_int
=
p_vcdplayer
->
i_titles
;
else
*
ppp_title
=
malloc
(
sizeof
(
input_title_t
**
)
*
p_vcdplayer
->
i_titles
);
if
(
!*
ppp_title
)
return
VLC_ENOMEM
;
for
(
i
=
0
;
i
<
p_vcdplayer
->
i_titles
;
i
++
)
{
{
if
(
p_vcdplayer
->
p_title
[
i
]
)
/* FIXME! i_tracks+2 are Segments, but we need to be able
(
*
ppp_title
)[
i
]
=
to figure out which segment of that. i_tracks+1 is
vlc_input_title_Duplicate
(
p_vcdplayer
->
p_title
[
i
]
);
either Segments (if no LIDs) or LIDs otherwise. Again
need a way to get the LID number. */
msg_Warn
(
p_access
,
"Trying to set track (%u) beyond end "
"of last track (%u)."
,
i
+
1
,
p_vcdplayer
->
i_tracks
);
return
VLC_EGENERIC
;
}
}
}
break
;
case
ACCESS_SET_TITLE
:
VCDSetOrigin
(
p_access
,
i
=
(
int
)
va_arg
(
args
,
int
);
vcdinfo_get_entry_lsn
(
p_vcdplayer
->
vcd
,
i_entry
),
i_track
,
&
itemid
);
}
break
;
dbg_print
(
INPUT_DBG_EVENT
,
"set title %d"
,
i
);
case
ACCESS_SET_SEEKPOINT
:
if
(
i
!=
p_access
->
info
.
i_title
)
{
{
input_title_t
*
t
=
p_vcdplayer
->
p_title
[
p_access
->
info
.
i_title
];
vcdinfo_itemid_t
itemid
;
unsigned
int
i
=
(
unsigned
int
)
va_arg
(
args
,
unsigned
int
);
track_t
i_track
=
i
+
1
;
unsigned
int
i_entry
=
vcdinfo_track_get_entry
(
p_vcdplayer
->
vcd
,
i_track
);
if
(
i
<
p_vcdplayer
->
i_tracks
)
dbg_print
(
INPUT_DBG_EVENT
,
"set seekpoint %d"
,
i
);
{
if
(
t
->
i_seekpoint
>
0
)
/* FIXME! For now we are assuming titles are only
tracks and that track == title+1 */
itemid
.
num
=
i_track
;
itemid
.
type
=
VCDINFO_ITEM_TYPE_TRACK
;
}
else
{
{
/* FIXME! i_tracks+2 are Segments, but we need to
track_t
i_track
=
p_access
->
info
.
i_title
+
1
;
be able to figure out which segment of that.
lsn_t
lsn
;
i_tracks+1 is either Segments (if no LIDs) or
LIDs otherwise. Again need a way to get the LID
number. */
msg_Warn
(
p_access
,
"Trying to set track (%u) beyond end of last track (%u)."
,
i
+
1
,
p_vcdplayer
->
i_tracks
);
return
VLC_EGENERIC
;
}
VCDSetOrigin
(
p_access
,
vcdinfo_get_entry_lsn
(
p_vcdplayer
->
vcd
,
i_entry
),
i_track
,
&
itemid
);
}
break
;
case
ACCESS_SET_SEEKPOINT
:
/* FIXME! For now we are assuming titles are only tracks and
{
that track == title+1 and we the play item is entries (not
input_title_t
*
t
=
p_vcdplayer
->
p_title
[
p_access
->
info
.
i_title
];
tracks or lids). We need to generalize all of this.
unsigned
int
i
=
(
unsigned
int
)
va_arg
(
args
,
unsigned
int
);
*/
dbg_print
(
INPUT_DBG_EVENT
,
"set seekpoint %d"
,
i
);
if
(
i
<
p_vcdplayer
->
i_entries
)
if
(
t
->
i_seekpoint
>
0
)
{
{
track_t
i_track
=
p_access
->
info
.
i_title
+
1
;
p_vcdplayer
->
play_item
.
num
=
i
;
lsn_t
lsn
;
p_vcdplayer
->
play_item
.
type
=
VCDINFO_ITEM_TYPE_ENTRY
;
lsn
=
vcdinfo_get_entry_lsn
(
p_vcdplayer
->
vcd
,
i
);
/* FIXME! For now we are assuming titles are only
}
else
if
(
i
<
p_vcdplayer
->
i_entries
+
p_vcdplayer
->
i_lids
)
tracks and that track == title+1 and we the play
{
item is entries (not tracks or lids).
p_vcdplayer
->
play_item
.
num
=
i
=
i
-
p_vcdplayer
->
i_entries
;
We need to generalize all of this.
p_vcdplayer
->
play_item
.
type
=
VCDINFO_ITEM_TYPE_LID
;
*/
lsn
=
0
;
}
else
if
(
i
<
p_vcdplayer
->
i_entries
)
{
{
p_vcdplayer
->
play_item
.
num
=
i
p_vcdplayer
->
play_item
.
num
=
i
;
p_vcdplayer
->
play_item
.
type
=
VCDINFO_ITEM_TYPE_ENTRY
;
lsn
=
vcdinfo_get_entry_lsn
(
p_vcdplayer
->
vcd
,
i
);
}
else
if
(
i
<
p_vcdplayer
->
i_entries
+
p_vcdplayer
->
i_lids
)
{
p_vcdplayer
->
play_item
.
num
=
i
=
i
-
p_vcdplayer
->
i_entries
;
p_vcdplayer
->
play_item
.
type
=
VCDINFO_ITEM_TYPE_LID
;
lsn
=
0
;
}
else
{
p_vcdplayer
->
play_item
.
num
=
i
=
i
-
p_vcdplayer
->
i_entries
-
p_vcdplayer
->
i_lids
;
=
i
-
p_vcdplayer
->
i_entries
-
p_vcdplayer
->
i_lids
;
p_vcdplayer
->
play_item
.
type
=
VCDINFO_ITEM_TYPE_SEGMENT
;
p_vcdplayer
->
play_item
.
type
=
VCDINFO_ITEM_TYPE_SEGMENT
;
lsn
=
vcdinfo_get_seg_lsn
(
p_vcdplayer
->
vcd
,
i
);
lsn
=
vcdinfo_get_seg_lsn
(
p_vcdplayer
->
vcd
,
i
);
}
VCDSetOrigin
(
p_access
,
vcdinfo_get_entry_lsn
(
p_vcdplayer
->
vcd
,
i
),
i_track
,
&
(
p_vcdplayer
->
play_item
)
);
}
}
return
VLC_SUCCESS
;
VCDSetOrigin
(
p_access
,
vcdinfo_get_entry_lsn
(
p_vcdplayer
->
vcd
,
i
),
i_track
,
&
(
p_vcdplayer
->
play_item
));
}
}
return
VLC_SUCCESS
;
}
case
ACCESS_SET_PRIVATE_ID_STATE
:
case
ACCESS_SET_PRIVATE_ID_STATE
:
dbg_print
(
INPUT_DBG_EVENT
,
"set private id"
);
dbg_print
(
INPUT_DBG_EVENT
,
"set private id"
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
default:
default:
msg_Warn
(
p_access
,
"unimplemented query in control"
);
msg_Warn
(
p_access
,
"unimplemented query in control"
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
...
...
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