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
0986ff4a
Commit
0986ff4a
authored
Oct 10, 2012
by
Frédéric Yhuel
Committed by
Jean-Baptiste Kempf
Oct 12, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Smooth Streaming: don't use block_t
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
70459ae3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
18 deletions
+16
-18
modules/stream_filter/smooth/downloader.c
modules/stream_filter/smooth/downloader.c
+8
-9
modules/stream_filter/smooth/smooth.c
modules/stream_filter/smooth/smooth.c
+5
-5
modules/stream_filter/smooth/smooth.h
modules/stream_filter/smooth/smooth.h
+1
-1
modules/stream_filter/smooth/utils.c
modules/stream_filter/smooth/utils.c
+2
-3
No files found.
modules/stream_filter/smooth/downloader.c
View file @
0986ff4a
...
...
@@ -78,7 +78,7 @@ static unsigned set_track_id( chunk_t *chunk, const unsigned tid )
uint32_t
size
,
type
;
if
(
!
chunk
->
data
)
return
0
;
uint8_t
*
slice
=
chunk
->
data
->
p_buffer
;
uint8_t
*
slice
=
chunk
->
data
;
if
(
!
slice
)
return
0
;
...
...
@@ -121,7 +121,7 @@ static int sms_Download( stream_t *s, chunk_t *chunk, char *url )
chunk
->
offset
=
p_sys
->
download
.
next_chunk_offset
;
p_sys
->
download
.
next_chunk_offset
+=
chunk
->
size
;
chunk
->
data
=
block_A
lloc
(
size
);
chunk
->
data
=
ma
lloc
(
size
);
if
(
chunk
->
data
==
NULL
)
{
...
...
@@ -129,12 +129,12 @@ static int sms_Download( stream_t *s, chunk_t *chunk, char *url )
return
VLC_ENOMEM
;
}
int
read
=
stream_Read
(
p_ts
,
chunk
->
data
->
p_buffer
,
size
);
int
read
=
stream_Read
(
p_ts
,
chunk
->
data
,
size
);
if
(
read
<
size
)
{
msg_Warn
(
s
,
"sms_Download: I requested %"
PRIi64
" bytes, "
\
"but I got only %i"
,
size
,
read
);
chunk
->
data
=
block_Realloc
(
chunk
->
data
,
0
,
read
);
chunk
->
data
=
realloc
(
chunk
->
data
,
read
);
}
stream_Delete
(
p_ts
);
...
...
@@ -190,7 +190,7 @@ static int get_new_chunks( stream_t *s, chunk_t *ck )
{
stream_sys_t
*
p_sys
=
s
->
p_sys
;
uint8_t
*
slice
=
ck
->
data
->
p_buffer
;
uint8_t
*
slice
=
ck
->
data
;
if
(
!
slice
)
return
VLC_EGENERIC
;
uint8_t
version
,
fragment_count
;
...
...
@@ -359,11 +359,11 @@ static chunk_t *build_init_chunk( stream_t *s )
goto
build_init_chunk_error
;
ret
->
size
=
SMOO_SIZE
;
ret
->
data
=
block_A
lloc
(
SMOO_SIZE
);
ret
->
data
=
ma
lloc
(
SMOO_SIZE
);
if
(
!
ret
->
data
)
goto
build_init_chunk_error
;
int
res
=
build_smoo_box
(
s
,
ret
->
data
->
p_buffer
);
int
res
=
build_smoo_box
(
s
,
ret
->
data
);
if
(
res
!=
VLC_SUCCESS
)
goto
build_init_chunk_error
;
...
...
@@ -639,8 +639,7 @@ void* sms_Thread( void *p_this )
ck
->
read_pos
=
0
;
if
(
ck
->
data
==
NULL
)
continue
;
block_Release
(
ck
->
data
);
ck
->
data
=
NULL
;
FREENULL
(
ck
->
data
);
}
vlc_array_destroy
(
p_sys
->
download
.
chunks
);
...
...
modules/stream_filter/smooth/smooth.c
View file @
0986ff4a
...
...
@@ -570,8 +570,8 @@ static int sms_Read( stream_t *s, uint8_t *p_read, int i_read )
}
if
(
!
p_sys
->
b_cache
||
p_sys
->
b_live
)
{
block_Release
(
chunk
->
data
);
chunk
->
data
=
NULL
;
FREENULL
(
chunk
->
data
);
chunk
->
read_pos
=
0
;
}
chunk
->
read_pos
=
0
;
...
...
@@ -589,14 +589,14 @@ static int sms_Read( stream_t *s, uint8_t *p_read, int i_read )
verb
,
chunk
->
sequence
,
i_read
,
chunk
->
type
);
/* check integrity */
uint32_t
type
;
uint8_t
*
slice
=
chunk
->
data
->
p_buffer
;
uint8_t
*
slice
=
chunk
->
data
;
SMS_GET4BYTES
(
type
);
SMS_GETFOURCC
(
type
);
assert
(
type
==
ATOM_moof
||
type
==
ATOM_uuid
);
}
int
len
=
-
1
;
uint8_t
*
src
=
chunk
->
data
->
p_buffer
+
chunk
->
read_pos
;
uint8_t
*
src
=
chunk
->
data
+
chunk
->
read_pos
;
if
(
i_read
<=
chunk
->
size
-
chunk
->
read_pos
)
len
=
i_read
;
else
...
...
@@ -655,7 +655,7 @@ static int Peek( stream_t *s, const uint8_t **pp_peek, unsigned i_peek )
msg_Err
(
s
,
"could not peek %u bytes, only %i!"
,
i_peek
,
bytes
);
}
msg_Dbg
(
s
,
"peeking at chunk %u!"
,
chunk
->
sequence
);
*
pp_peek
=
chunk
->
data
->
p_buffer
+
chunk
->
read_pos
;
*
pp_peek
=
chunk
->
data
+
chunk
->
read_pos
;
return
bytes
;
}
...
...
modules/stream_filter/smooth/smooth.h
View file @
0986ff4a
...
...
@@ -49,7 +49,7 @@ typedef struct chunk_s
int
read_pos
;
/* position in the chunk */
int
type
;
/* video, audio, or subtitles */
block
_t
*
data
;
uint8
_t
*
data
;
}
chunk_t
;
typedef
struct
quality_level_s
...
...
modules/stream_filter/smooth/utils.c
View file @
0986ff4a
...
...
@@ -98,9 +98,8 @@ chunk_t *chunk_New( sms_stream_t* sms, uint64_t duration,\
void
chunk_Free
(
chunk_t
*
chunk
)
{
if
(
chunk
->
data
)
block_Release
(
chunk
->
data
);
free
(
chunk
);
chunk
=
NULL
;
FREENULL
(
chunk
->
data
);
FREENULL
(
chunk
);
}
sms_stream_t
*
sms_New
(
void
)
...
...
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