Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
f0156a28
Commit
f0156a28
authored
Mar 13, 2004
by
Laurent Aimar
Browse files
* mmsh: more fixes.
parent
d9043cc6
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/access/mms/mmsh.c
View file @
f0156a28
...
...
@@ -412,7 +412,15 @@ static ssize_t Read ( input_thread_t * p_input, byte_t * p_buffer,
while
(
i_data
<
i_len
)
{
if
(
p_sys
->
i_packet_used
<
p_sys
->
i_packet_length
)
if
(
p_sys
->
i_pos
<
p_sys
->
i_header
)
{
i_copy
=
__MIN
(
p_sys
->
i_header
-
p_sys
->
i_pos
,
i_len
-
i_data
);
memcpy
(
&
p_buffer
[
i_data
],
p_sys
->
p_header
,
i_copy
);
i_data
+=
i_copy
;
p_sys
->
i_pos
+=
i_copy
;
}
else
if
(
p_sys
->
i_packet_used
<
p_sys
->
i_packet_length
)
{
i_copy
=
__MIN
(
p_sys
->
i_packet_length
-
p_sys
->
i_packet_used
,
i_len
-
i_data
);
...
...
@@ -423,6 +431,7 @@ static ssize_t Read ( input_thread_t * p_input, byte_t * p_buffer,
i_data
+=
i_copy
;
p_sys
->
i_packet_used
+=
i_copy
;
p_sys
->
i_pos
+=
i_copy
;
}
else
if
(
p_sys
->
i_pos
+
i_data
>
p_sys
->
i_header
&&
(
int
)
p_sys
->
i_packet_used
<
p_sys
->
asfh
.
i_min_data_packet_size
)
...
...
@@ -434,6 +443,7 @@ static ssize_t Read ( input_thread_t * p_input, byte_t * p_buffer,
i_data
+=
i_copy
;
p_sys
->
i_packet_used
+=
i_copy
;
p_sys
->
i_pos
+=
i_copy
;
}
else
{
...
...
@@ -442,11 +452,14 @@ static ssize_t Read ( input_thread_t * p_input, byte_t * p_buffer,
{
return
-
1
;
}
if
(
ck
.
i_type
==
0x4824
)
{
p_sys
->
i_packet_used
=
0
;
p_sys
->
i_packet_length
=
0
;
}
}
}
p_sys
->
i_pos
+=
i_data
;
return
(
i_data
);
}
...
...
@@ -567,6 +580,9 @@ static int Start( input_thread_t *p_input, off_t i_pos )
free
(
psz
);
}
p_sys
->
i_packet_used
=
0
;
p_sys
->
i_packet_length
=
0
;
return
VLC_SUCCESS
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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