Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
52945c01
Commit
52945c01
authored
Nov 01, 2001
by
Sam Hocevar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Modified the pf_close kludge in input.c so that we don't segfault when pf_init fails.
parent
1223a96c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
20 deletions
+41
-20
src/input/input.c
src/input/input.c
+41
-20
No files found.
src/input/input.c
View file @
52945c01
...
...
@@ -4,7 +4,7 @@
* decoders.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input.c,v 1.14
7 2001/10/30 10:57:37 massiot
Exp $
* $Id: input.c,v 1.14
8 2001/11/01 15:30:50 sam
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -415,17 +415,18 @@ static int InitThread( input_thread_t * p_input )
p_input
->
pf_delete_pes
=
f
.
pf_delete_pes
;
p_input
->
pf_rewind
=
f
.
pf_rewind
;
p_input
->
pf_seek
=
f
.
pf_seek
;
#undef f
#if !defined( SYS_BEOS ) && !defined( SYS_NTO )
/* FIXME : this is waaaay too kludgy */
if
(
(
strlen
(
p_input
->
p_source
)
>
3
)
&&
!
strncasecmp
(
p_input
->
p_source
,
"ts:"
,
3
)
)
if
(
(
strlen
(
p_input
->
p_source
)
>
3
)
&&
!
strncasecmp
(
p_input
->
p_source
,
"ts:"
,
3
)
)
{
/* Network stream */
NetworkOpen
(
p_input
);
p_input
->
stream
.
i_method
=
INPUT_METHOD_NETWORK
;
}
else
if
(
(
strlen
(
p_input
->
p_source
)
>
5
)
&&
!
strncasecmp
(
p_input
->
p_source
,
"http:"
,
5
)
)
else
if
(
(
strlen
(
p_input
->
p_source
)
>
5
)
&&
!
strncasecmp
(
p_input
->
p_source
,
"http:"
,
5
)
)
{
/* HTTP stream */
HTTPOpen
(
p_input
);
...
...
@@ -433,18 +434,21 @@ static int InitThread( input_thread_t * p_input )
}
else
#endif
if
(
(
strlen
(
p_input
->
p_source
)
>
4
)
&&
!
strncasecmp
(
p_input
->
p_source
,
"dvd:"
,
4
)
)
if
(
(
strlen
(
p_input
->
p_source
)
>
4
)
&&
!
strncasecmp
(
p_input
->
p_source
,
"dvd:"
,
4
)
)
{
/* DVD - this is THE kludge */
p_input
->
p_input_module
->
p_functions
->
input
.
functions
.
input
.
pf_open
(
p_input
);
f
.
pf_open
(
p_input
);
p_input
->
stream
.
i_method
=
INPUT_METHOD_DVD
;
}
else
if
(
(
strlen
(
p_input
->
p_source
)
>
4
)
&&
!
strncasecmp
(
p_input
->
p_source
,
"vlc:"
,
4
)
)
else
if
(
(
strlen
(
p_input
->
p_source
)
>
4
)
&&
!
strncasecmp
(
p_input
->
p_source
,
"vlc:"
,
4
)
)
{
/* Dummy input - very kludgy */
p_input
->
p_input_module
->
p_functions
->
input
.
functions
.
input
.
pf_open
(
p_input
);
f
.
pf_open
(
p_input
);
}
else
if
(
(
strlen
(
p_input
->
p_source
)
==
1
)
&&
*
p_input
->
p_source
==
'-'
)
else
if
(
(
strlen
(
p_input
->
p_source
)
==
1
)
&&
*
p_input
->
p_source
==
'-'
)
{
/* Stdin */
StdOpen
(
p_input
);
...
...
@@ -455,6 +459,7 @@ static int InitThread( input_thread_t * p_input )
FileOpen
(
p_input
);
p_input
->
stream
.
i_method
=
INPUT_METHOD_FILE
;
}
#undef f
if
(
p_input
->
b_error
)
{
...
...
@@ -468,7 +473,7 @@ static int InitThread( input_thread_t * p_input )
if
(
p_input
->
b_error
)
{
/* We barfed -- exit nicely */
p_input
->
pf_close
(
p_input
);
CloseThread
(
p_input
);
module_Unneed
(
p_input
->
p_input_module
);
return
(
-
1
);
}
...
...
@@ -526,34 +531,50 @@ static void EndThread( input_thread_t * p_input )
/* Free demultiplexer's data */
p_input
->
pf_end
(
p_input
);
/* Close the input method */
CloseThread
(
p_input
);
/* Release modules */
module_Unneed
(
p_input
->
p_input_module
);
}
/*****************************************************************************
* CloseThread: close the target
*****************************************************************************/
static
void
CloseThread
(
input_thread_t
*
p_input
)
{
#define f p_input->p_input_module->p_functions->input.functions.input
#if !defined( SYS_BEOS ) && !defined( SYS_NTO )
/* Close stream */
if
(
(
strlen
(
p_input
->
p_source
)
>
3
)
&&
!
strncasecmp
(
p_input
->
p_source
,
"ts:"
,
3
)
)
if
(
(
strlen
(
p_input
->
p_source
)
>
3
)
&&
!
strncasecmp
(
p_input
->
p_source
,
"ts:"
,
3
)
)
{
NetworkClose
(
p_input
);
}
else
if
(
(
strlen
(
p_input
->
p_source
)
>
5
)
&&
!
strncasecmp
(
p_input
->
p_source
,
"http:"
,
5
)
)
else
if
(
(
strlen
(
p_input
->
p_source
)
>
5
)
&&
!
strncasecmp
(
p_input
->
p_source
,
"http:"
,
5
)
)
{
NetworkClose
(
p_input
);
}
else
#endif
if
(
(
strlen
(
p_input
->
p_source
)
>
4
)
&&
!
strncasecmp
(
p_input
->
p_source
,
"dvd:"
,
4
)
)
if
(
(
strlen
(
p_input
->
p_source
)
>
4
)
&&
!
strncasecmp
(
p_input
->
p_source
,
"dvd:"
,
4
)
)
{
p_input
->
p_input_module
->
p_functions
->
input
.
functions
.
input
.
pf_close
(
p_input
);
f
.
pf_close
(
p_input
);
}
else
if
(
(
strlen
(
p_input
->
p_source
)
>
4
)
&&
!
strncasecmp
(
p_input
->
p_source
,
"vlc:"
,
4
)
)
else
if
(
(
strlen
(
p_input
->
p_source
)
>
4
)
&&
!
strncasecmp
(
p_input
->
p_source
,
"vlc:"
,
4
)
)
{
p_input
->
p_input_module
->
p_functions
->
input
.
functions
.
input
.
pf_close
(
p_input
);
f
.
pf_close
(
p_input
);
}
else
{
FileClose
(
p_input
);
}
/* Release modules */
module_Unneed
(
p_input
->
p_input_module
);
#undef f
}
/*****************************************************************************
...
...
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