Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
f15e81c7
Commit
f15e81c7
authored
Jul 28, 2008
by
Derk-Jan Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vcd module: fix .cue loading. was failing on .cue's for MP3s
parent
496977e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
21 deletions
+31
-21
modules/access/vcd/cdrom.c
modules/access/vcd/cdrom.c
+31
-21
No files found.
modules/access/vcd/cdrom.c
View file @
f15e81c7
...
...
@@ -821,6 +821,7 @@ static int OpenVCDImage( vlc_object_t * p_this, const char *psz_dev,
char
*
psz_cuefile
=
NULL
;
FILE
*
cuefile
=
NULL
;
char
line
[
1024
];
bool
b_found
=
false
;
/* Check if we are dealing with a .cue file */
p_pos
=
strrchr
(
psz_dev
,
'.'
);
...
...
@@ -862,35 +863,44 @@ static int OpenVCDImage( vlc_object_t * p_this, const char *psz_dev,
goto
error
;
}
msg_Dbg
(
p_this
,
"
u
sing vcd image file: %s"
,
psz_vcdfile
);
msg_Dbg
(
p_this
,
"
gues
sing vcd image file: %s"
,
psz_vcdfile
);
p_vcddev
->
i_vcdimage_handle
=
utf8_open
(
psz_vcdfile
,
O_RDONLY
|
O_NONBLOCK
|
O_BINARY
,
0666
);
if
(
p_vcddev
->
i_vcdimage_handle
==
-
1
&&
fscanf
(
cuefile
,
"FILE %c"
,
line
)
&&
fgets
(
line
,
1024
,
cuefile
)
)
while
(
fgets
(
line
,
1024
,
cuefile
)
&&
!
b_found
)
{
/* We have a cue file, but no valid vcd file yet */
free
(
psz_vcdfile
);
p_pos
=
strchr
(
line
,
'"'
);
if
(
p_pos
)
char
filename
[
1024
];
char
type
[
16
];
int
i_temp
=
sscanf
(
line
,
"FILE
\"
%1023[^
\"
]
\"
%15s"
,
filename
,
type
);
*
p_pos
=
0
;
switch
(
i_temp
)
{
*
p_pos
=
0
;
/* Take care of path standardization */
if
(
*
line
!=
'/'
&&
((
p_pos
=
strrchr
(
psz_cuefile
,
'/'
))
||
(
p_pos
=
strrchr
(
psz_cuefile
,
'\\'
)
))
)
{
psz_vcdfile
=
malloc
(
strlen
(
line
)
+
case
2
:
msg_Dbg
(
p_this
,
"the cue file says the data file is %s"
,
type
);
if
(
strcasecmp
(
type
,
"BINARY"
)
)
goto
error
;
/* Error if not binary, otherwise treat as case 1 */
case
1
:
if
(
p_vcddev
->
i_vcdimage_handle
==
-
1
)
{
msg_Dbg
(
p_this
,
"we could not find the data file, but we found a new path"
);
free
(
psz_vcdfile
);
if
(
*
filename
!=
'/'
&&
((
p_pos
=
strrchr
(
psz_cuefile
,
'/'
))
||
(
p_pos
=
strrchr
(
psz_cuefile
,
'\\'
)
))
)
{
psz_vcdfile
=
malloc
(
strlen
(
filename
)
+
(
p_pos
-
psz_cuefile
+
1
)
+
1
);
strncpy
(
psz_vcdfile
,
psz_cuefile
,
(
p_pos
-
psz_cuefile
+
1
)
);
strcpy
(
psz_vcdfile
+
(
p_pos
-
psz_cuefile
+
1
),
line
);
}
else
psz_vcdfile
=
strdup
(
line
);
}
msg_Dbg
(
p_this
,
"using vcd image file: %s"
,
psz_vcdfile
);
p_vcddev
->
i_vcdimage_handle
=
utf8_open
(
psz_vcdfile
,
strncpy
(
psz_vcdfile
,
psz_cuefile
,
(
p_pos
-
psz_cuefile
+
1
)
);
strcpy
(
psz_vcdfile
+
(
p_pos
-
psz_cuefile
+
1
),
filename
);
}
else
psz_vcdfile
=
strdup
(
filename
);
msg_Dbg
(
p_this
,
"using vcd image file: %s"
,
psz_vcdfile
);
p_vcddev
->
i_vcdimage_handle
=
utf8_open
(
psz_vcdfile
,
O_RDONLY
|
O_NONBLOCK
|
O_BINARY
,
0666
);
}
b_found
=
true
;
default:
break
;
}
}
if
(
p_vcddev
->
i_vcdimage_handle
==
-
1
)
...
...
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