Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
be256141
Commit
be256141
authored
Jul 07, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmsh: reimplement seeking
Fixes Ticket2682 Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
c7cfd4cc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
16 deletions
+17
-16
mmsh.c
libavformat/mmsh.c
+17
-16
No files found.
libavformat/mmsh.c
View file @
be256141
...
...
@@ -309,16 +309,14 @@ static int mmsh_open_internal(URLContext *h, const char *uri, int flags, int tim
return
0
;
fail:
av_freep
(
&
stream_selection
);
mmsh_close
(
h
);
av_dlog
(
NULL
,
"Connection failed with error %d
\n
"
,
err
);
return
err
;
}
static
int
mmsh_open
(
URLContext
*
h
,
const
char
*
uri
,
int
flags
)
{
int
ret
=
mmsh_open_internal
(
h
,
uri
,
flags
,
0
,
0
);
if
(
ret
<
0
)
mmsh_close
(
h
);
return
ret
;
return
mmsh_open_internal
(
h
,
uri
,
flags
,
0
,
0
);
}
static
int
handle_chunk_type
(
MMSHContext
*
mmsh
)
...
...
@@ -370,23 +368,26 @@ static int mmsh_read(URLContext *h, uint8_t *buf, int size)
static
int64_t
mmsh_read_seek
(
URLContext
*
h
,
int
stream_index
,
int64_t
timestamp
,
int
flags
)
{
MMSHContext
*
mmsh
=
h
->
priv_data
;
MMS
Context
*
mms
=
&
mmsh
->
mms
;
MMSHContext
*
mmsh
_old
=
h
->
priv_data
;
MMS
HContext
*
mmsh
=
av_mallocz
(
sizeof
(
*
mmsh
))
;
int
ret
;
ret
=
mmsh_open_internal
(
h
,
mmsh
->
location
,
0
,
FFMAX
(
timestamp
,
0
),
0
);
if
(
!
mmsh
)
return
AVERROR
(
ENOMEM
);
h
->
priv_data
=
mmsh
;
ret
=
mmsh_open_internal
(
h
,
mmsh_old
->
location
,
0
,
FFMAX
(
timestamp
,
0
),
0
);
if
(
ret
>=
0
){
if
(
mms
->
mms_hd
)
ffurl_close
(
mms
->
mms_hd
);
av_freep
(
&
mms
->
streams
);
av_freep
(
&
mms
->
asf_header
);
h
->
priv_data
=
mmsh_old
;
mmsh_close
(
h
);
h
->
priv_data
=
mmsh
;
av_free
(
mmsh_old
);
mmsh
->
mms
.
asf_header_read_size
=
mmsh
->
mms
.
asf_header_size
;
}
else
{
h
->
priv_data
=
mmsh_old
;
av_free
(
mmsh
);
mmsh
=
h
->
priv_data
;
mms
=
&
mmsh
->
mms
;
mms
->
asf_header_read_size
=
mms
->
asf_header_size
;
}
else
h
->
priv_data
=
mmsh
;
}
return
ret
;
}
...
...
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