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
5f118ca9
Commit
5f118ca9
authored
Jul 10, 2010
by
Ilkka Ollakka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat: fix non-file usage after [
1644d683
]
Fixes eg youtube viewing.
parent
b1a700d1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
4 deletions
+28
-4
modules/demux/avformat/demux.c
modules/demux/avformat/demux.c
+28
-4
No files found.
modules/demux/avformat/demux.c
View file @
5f118ca9
...
...
@@ -117,11 +117,21 @@ int OpenDemux( vlc_object_t *p_this )
unsigned
int
i
;
int64_t
i_start_time
=
-
1
;
bool
b_can_seek
;
char
*
psz_url
;
if
(
p_demux
->
psz_file
)
psz_url
=
strdup
(
p_demux
->
psz_file
);
else
{
if
(
asprintf
(
&
psz_url
,
"%s://%s"
,
p_demux
->
psz_access
,
p_demux
->
psz_location
)
==
-
1
)
return
VLC_ENOMEM
;
}
msg_Dbg
(
p_demux
,
"trying url: %s"
,
psz_url
);
/* Init Probe data */
pd
.
filename
=
p
_demux
->
psz_file
;
pd
.
filename
=
p
sz_url
;
if
(
(
pd
.
buf_size
=
stream_Peek
(
p_demux
->
s
,
&
pd
.
buf
,
2048
+
213
)
)
<=
0
)
{
free
(
psz_url
);
msg_Warn
(
p_demux
,
"cannot peek"
);
return
VLC_EGENERIC
;
}
...
...
@@ -134,6 +144,7 @@ int OpenDemux( vlc_object_t *p_this )
if
(
!
(
fmt
=
av_probe_input_format
(
&
pd
,
1
)
)
)
{
msg_Dbg
(
p_demux
,
"couldn't guess format"
);
free
(
psz_url
);
return
VLC_EGENERIC
;
}
...
...
@@ -147,6 +158,7 @@ int OpenDemux( vlc_object_t *p_this )
!
strcmp
(
fmt
->
name
,
"redir"
)
||
!
strcmp
(
fmt
->
name
,
"sdp"
)
)
)
{
free
(
psz_url
);
return
VLC_EGENERIC
;
}
...
...
@@ -155,15 +167,24 @@ int OpenDemux( vlc_object_t *p_this )
{
int
i_len
;
if
(
!
p_demux
->
psz_file
)
return
VLC_EGENERIC
;
if
(
!
p_demux
->
psz_file
)
{
free
(
psz_url
);
return
VLC_EGENERIC
;
}
i_len
=
strlen
(
p_demux
->
psz_file
);
if
(
i_len
<
4
)
return
VLC_EGENERIC
;
if
(
i_len
<
4
)
{
free
(
psz_url
);
return
VLC_EGENERIC
;
}
if
(
strcasecmp
(
&
p_demux
->
psz_file
[
i_len
-
4
],
".str"
)
&&
strcasecmp
(
&
p_demux
->
psz_file
[
i_len
-
4
],
".xai"
)
&&
strcasecmp
(
&
p_demux
->
psz_file
[
i_len
-
3
],
".xa"
)
)
{
free
(
psz_url
);
return
VLC_EGENERIC
;
}
}
...
...
@@ -214,13 +235,16 @@ int OpenDemux( vlc_object_t *p_this )
/* Open it */
if
(
av_open_input_stream
(
&
p_sys
->
ic
,
&
p_sys
->
io
,
p
_demux
->
psz_file
,
if
(
av_open_input_stream
(
&
p_sys
->
ic
,
&
p_sys
->
io
,
p
sz_url
,
p_sys
->
fmt
,
NULL
)
)
{
msg_Err
(
p_demux
,
"av_open_input_stream failed"
);
free
(
psz_url
);
CloseDemux
(
p_this
);
return
VLC_EGENERIC
;
}
free
(
psz_url
);
psz_url
=
NULL
;
vlc_avcodec_lock
();
/* avformat calls avcodec behind our back!!! */
if
(
av_find_stream_info
(
p_sys
->
ic
)
<
0
)
...
...
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