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
8c4fc701
Commit
8c4fc701
authored
Apr 04, 2004
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* mms: fixed 'Read' function when the header is bigger than the packet
size.
parent
ae074ecf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
29 deletions
+18
-29
modules/access/mms/mmsh.c
modules/access/mms/mmsh.c
+1
-1
modules/access/mms/mmstu.c
modules/access/mms/mmstu.c
+17
-28
No files found.
modules/access/mms/mmsh.c
View file @
8c4fc701
...
...
@@ -415,7 +415,7 @@ static ssize_t Read ( input_thread_t * p_input, byte_t * p_buffer,
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
);
memcpy
(
&
p_buffer
[
i_data
],
&
p_sys
->
p_header
[
p_sys
->
i_pos
]
,
i_copy
);
i_data
+=
i_copy
;
p_sys
->
i_pos
+=
i_copy
;
...
...
modules/access/mms/mmstu.c
View file @
8c4fc701
...
...
@@ -2,7 +2,7 @@
* mms.c: MMS access plug-in
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id
: mmstu.c,v 1.9 2004/02/12 20:09:38 fenrir Exp
$
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
...
...
@@ -345,55 +345,44 @@ static ssize_t Read( input_thread_t *p_input, byte_t *p_buffer, size_t i_len )
i_data
=
0
;
/* *** send header if needed ** */
/* *** now send data if needed *** */
while
(
i_data
<
i_len
)
{
if
(
p_sys
->
i_pos
<
p_sys
->
i_header
)
{
i_copy
=
__MIN
(
i_len
,
p_sys
->
i_header
-
p_sys
->
i_pos
);
if
(
i_copy
>
0
)
{
memcpy
(
p_buffer
,
p_sys
->
p_header
+
p_sys
->
i_pos
,
i_copy
);
}
memcpy
(
&
p_buffer
[
i_data
],
&
p_sys
->
p_header
[
p_sys
->
i_pos
],
i_copy
);
i_data
+=
i_copy
;
p_sys
->
i_pos
+=
i_copy
;
}
/* *** now send data if needed *** */
while
(
i_data
<
i_len
)
{
if
(
p_sys
->
i_media_used
<
p_sys
->
i_media
)
else
if
(
p_sys
->
i_media_used
<
p_sys
->
i_media
)
{
i_copy
=
__MIN
(
i_len
-
i_data
,
p_sys
->
i_media
-
p_sys
->
i_media_used
);
memcpy
(
p_buffer
+
i_data
,
p_sys
->
p_media
+
p_sys
->
i_media_used
,
i_copy
);
memcpy
(
&
p_buffer
[
i_data
],
&
p_sys
->
p_media
[
p_sys
->
i_media_used
],
i_copy
);
i_data
+=
i_copy
;
p_sys
->
i_media_used
+=
i_copy
;
p_sys
->
i_pos
+=
i_copy
;
}
else
if
(
p_sys
->
p_media
!=
NULL
&&
p_sys
->
i_media_used
<
p_sys
->
i_packet_length
)
{
i_copy
=
__MIN
(
i_len
-
i_data
,
p_sys
->
i_packet_length
-
p_sys
->
i_media_used
);
memset
(
p_buffer
+
i_data
,
0
,
i_copy
);
memset
(
&
p_buffer
[
i_data
]
,
0
,
i_copy
);
i_data
+=
i_copy
;
p_sys
->
i_media_used
+=
i_copy
;
p_sys
->
i_pos
+=
i_copy
;
}
else
else
if
(
p_sys
->
i_eos
||
mms_HeaderMediaRead
(
p_input
,
MMS_PACKET_MEDIA
)
<
0
)
{
if
(
p_sys
->
i_eos
||
mms_HeaderMediaRead
(
p_input
,
MMS_PACKET_MEDIA
)
<
0
)
{
p_sys
->
i_pos
+=
i_data
;
return
(
i_data
);
}
break
;
}
}
p_sys
->
i_pos
+=
i_data
;
return
(
i_data
);
return
i_data
;
}
/****************************************************************************
...
...
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