Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
1d08e9ca
Commit
1d08e9ca
authored
Aug 27, 2004
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/mux/asf.c: flush our buffers on close.
parent
00bee693
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
29 deletions
+46
-29
modules/mux/asf.c
modules/mux/asf.c
+46
-29
No files found.
modules/mux/asf.c
View file @
1d08e9ca
...
...
@@ -138,9 +138,10 @@ struct sout_mux_sys_t
static
int
MuxGetStream
(
sout_mux_t
*
,
int
*
pi_stream
,
mtime_t
*
pi_dts
);
static
block_t
*
asf_header_create
(
sout_mux_t
*
,
vlc_bool_t
b_broadcast
);
static
block_t
*
asf_header_create
(
sout_mux_t
*
,
vlc_bool_t
);
static
block_t
*
asf_packet_create
(
sout_mux_t
*
,
asf_track_t
*
,
block_t
*
);
static
block_t
*
asf_stream_end_create
(
sout_mux_t
*
);
static
block_t
*
asf_packet_flush
(
sout_mux_t
*
);
typedef
struct
{
...
...
@@ -243,6 +244,12 @@ static void Close( vlc_object_t * p_this )
msg_Dbg
(
p_mux
,
"Asf muxer closed"
);
/* Flush last packet if any */
if
(
(
out
=
asf_packet_flush
(
p_mux
)
)
)
{
sout_AccessOutWrite
(
p_mux
->
p_access
,
out
);
}
if
(
(
out
=
asf_stream_end_create
(
p_mux
)
)
)
{
sout_AccessOutWrite
(
p_mux
->
p_access
,
out
);
...
...
@@ -387,7 +394,6 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
return
VLC_EGENERIC
;
}
tk
->
i_extra
=
sizeof
(
WAVEFORMATEX
)
+
p_input
->
p_fmt
->
i_extra
+
i_extra
;
tk
->
p_extra
=
malloc
(
tk
->
i_extra
);
...
...
@@ -930,6 +936,41 @@ static block_t *asf_header_create( sout_mux_t *p_mux, vlc_bool_t b_broadcast )
/****************************************************************************
*
****************************************************************************/
static
block_t
*
asf_packet_flush
(
sout_mux_t
*
p_mux
)
{
sout_mux_sys_t
*
p_sys
=
p_mux
->
p_sys
;
int
i_pad
,
i_preheader
=
p_sys
->
b_asf_http
?
12
:
0
;
block_t
*
pk
;
bo_t
bo
;
if
(
!
p_sys
->
pk
)
return
0
;
i_pad
=
p_sys
->
i_packet_size
-
p_sys
->
i_pk_used
;
memset
(
p_sys
->
pk
->
p_buffer
+
p_sys
->
i_pk_used
,
0
,
i_pad
);
bo_init
(
&
bo
,
p_sys
->
pk
->
p_buffer
,
14
+
i_preheader
);
if
(
p_sys
->
b_asf_http
)
asf_chunk_add
(
&
bo
,
0x4424
,
p_sys
->
i_packet_size
,
0x0
,
p_sys
->
i_seq
++
);
bo_add_u8
(
&
bo
,
0x82
);
bo_addle_u16
(
&
bo
,
0
);
bo_add_u8
(
&
bo
,
0x11
);
bo_add_u8
(
&
bo
,
0x5d
);
bo_addle_u16
(
&
bo
,
i_pad
);
bo_addle_u32
(
&
bo
,
(
p_sys
->
i_pk_dts
-
p_sys
->
i_dts_first
)
/
1000
+
p_sys
->
i_preroll_time
);
bo_addle_u16
(
&
bo
,
0
/* data->i_length */
);
bo_add_u8
(
&
bo
,
0x80
|
p_sys
->
i_pk_frame
);
pk
=
p_sys
->
pk
;
p_sys
->
pk
=
NULL
;
p_sys
->
i_packet_count
++
;
return
pk
;
}
static
block_t
*
asf_packet_create
(
sout_mux_t
*
p_mux
,
asf_track_t
*
tk
,
block_t
*
data
)
{
...
...
@@ -979,33 +1020,9 @@ static block_t *asf_packet_create( sout_mux_t *p_mux,
if
(
p_sys
->
i_pk_used
+
17
>=
p_sys
->
i_packet_size
)
{
/* not enough data for another payload, flush the packet */
int
i_pad
=
p_sys
->
i_packet_size
-
p_sys
->
i_pk_used
;
bo_init
(
&
bo
,
p_sys
->
pk
->
p_buffer
,
14
+
i_preheader
);
if
(
p_sys
->
b_asf_http
)
{
asf_chunk_add
(
&
bo
,
0x4424
,
p_sys
->
i_packet_size
,
0x00
,
p_sys
->
i_seq
++
);
}
bo_add_u8
(
&
bo
,
0x82
);
bo_addle_u16
(
&
bo
,
0
);
bo_add_u8
(
&
bo
,
0x11
);
bo_add_u8
(
&
bo
,
0x5d
);
bo_addle_u16
(
&
bo
,
i_pad
);
bo_addle_u32
(
&
bo
,
(
p_sys
->
i_pk_dts
-
p_sys
->
i_dts_first
)
/
1000
+
p_sys
->
i_preroll_time
);
bo_addle_u16
(
&
bo
,
0
*
data
->
i_length
/
1000
);
bo_add_u8
(
&
bo
,
0x80
|
p_sys
->
i_pk_frame
);
/* append the packet */
*
last
=
p_sys
->
pk
;
last
=
&
p_sys
->
pk
->
p_next
;
p_sys
->
pk
=
NULL
;
p_sys
->
i_packet_count
++
;
/* Not enough data for another payload, flush the packet */
*
last
=
asf_packet_flush
(
p_mux
);
last
=
&
(
*
last
)
->
p_next
;
}
}
...
...
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