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
9fbf506f
Commit
9fbf506f
authored
Sep 28, 2003
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/mux/ogg.c: each ogg stream has to be cleared in OggCreateHeader().
parent
bff03e0b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
5 deletions
+31
-5
modules/mux/ogg.c
modules/mux/ogg.c
+31
-5
No files found.
modules/mux/ogg.c
View file @
9fbf506f
...
...
@@ -2,7 +2,7 @@
* ogg.c: ogg muxer module for vlc
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: ogg.c,v 1.1
0 2003/09/28 16:50:04
gbazin Exp $
* $Id: ogg.c,v 1.1
1 2003/09/28 19:58:19
gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
...
...
@@ -347,11 +347,12 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
p_input
->
p_fmt
->
i_width
);
SetDWLE
(
&
p_stream
->
header
.
header
.
video
.
i_height
,
p_input
->
p_fmt
->
i_height
);
msg_Dbg
(
p_mux
,
"mp4v/div3 stream"
);
break
;
case
VLC_FOURCC
(
't'
,
'h'
,
'e'
,
'o'
):
msg_Dbg
(
p_mux
,
"theora stream"
);
break
;
msg_Dbg
(
p_mux
,
"theora stream"
);
break
;
default:
FREE
(
p_input
->
p_sys
);
...
...
@@ -386,6 +387,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
SetDWLE
(
&
p_stream
->
header
.
header
.
audio
.
i_block_align
,
p_input
->
p_fmt
->
i_block_align
);
SetDWLE
(
&
p_stream
->
header
.
header
.
audio
.
i_avgbytespersec
,
0
);
msg_Dbg
(
p_mux
,
"mpga/a52 stream"
);
break
;
case
VLC_FOURCC
(
'v'
,
'o'
,
'r'
,
'b'
):
...
...
@@ -403,6 +405,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
{
case
VLC_FOURCC
(
's'
,
'u'
,
'b'
,
't'
):
memcpy
(
p_stream
->
header
.
stream_type
,
"text "
,
8
);
msg_Dbg
(
p_mux
,
"subtitles stream"
);
break
;
default:
...
...
@@ -415,7 +418,6 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
return
(
VLC_EGENERIC
);
}
ogg_stream_init
(
&
p_stream
->
os
,
rand
()
);
p_stream
->
b_new
=
VLC_TRUE
;
p_sys
->
i_add_streams
++
;
...
...
@@ -483,6 +485,7 @@ static sout_buffer_t *OggStreamFlush( sout_mux_t *p_mux,
{
break
;
}
i_size
=
og
.
header_len
+
og
.
body_len
;
p_og
=
sout_BufferNew
(
p_mux
->
p_sout
,
i_size
);
...
...
@@ -516,6 +519,7 @@ static sout_buffer_t *OggStreamPageOut( sout_mux_t *p_mux,
{
break
;
}
i_size
=
og
.
header_len
+
og
.
body_len
;
p_og
=
sout_BufferNew
(
p_mux
->
p_sout
,
i_size
);
...
...
@@ -548,6 +552,12 @@ static sout_buffer_t *OggCreateHeader( sout_mux_t *p_mux, mtime_t i_dts )
ogg_stream_t
*
p_stream
=
(
ogg_stream_t
*
)
p_mux
->
pp_inputs
[
i
]
->
p_sys
;
p_stream
->
b_new
=
VLC_FALSE
;
msg_Dbg
(
p_mux
,
"creating header for %4.4s"
,
(
char
*
)
&
p_stream
->
i_fourcc
);
ogg_stream_init
(
&
p_stream
->
os
,
rand
()
);
p_stream
->
i_packet_no
=
0
;
if
(
p_stream
->
i_fourcc
==
VLC_FOURCC
(
'v'
,
'o'
,
'r'
,
'b'
)
||
p_stream
->
i_fourcc
==
VLC_FOURCC
(
't'
,
'h'
,
'e'
,
'o'
)
)
{
...
...
@@ -641,6 +651,21 @@ static sout_buffer_t *OggCreateFooter( sout_mux_t *p_mux, mtime_t i_dts )
ogg_packet
op
;
int
i
;
/* flush all remaining data */
for
(
i
=
0
;
i
<
p_mux
->
i_nb_inputs
;
i
++
)
{
ogg_stream_t
*
p_stream
=
p_mux
->
pp_inputs
[
i
]
->
p_sys
;
/* skip newly added streams */
if
(
p_stream
->
b_new
)
continue
;
if
(
(
p_og
=
OggStreamFlush
(
p_mux
,
&
p_stream
->
os
,
0
)
)
)
{
OggSetDate
(
p_og
,
p_stream
->
i_dts
,
p_stream
->
i_length
);
sout_AccessOutWrite
(
p_mux
->
p_access
,
p_og
);
}
}
/* Write eos packets for each stream. */
for
(
i
=
0
;
i
<
p_mux
->
i_nb_inputs
;
i
++
)
{
...
...
@@ -659,6 +684,7 @@ static sout_buffer_t *OggCreateFooter( sout_mux_t *p_mux, mtime_t i_dts )
p_og
=
OggStreamFlush
(
p_mux
,
&
p_stream
->
os
,
0
);
sout_BufferChain
(
&
p_hdr
,
p_og
);
ogg_stream_clear
(
&
p_stream
->
os
);
}
for
(
i
=
0
;
i
<
p_sys
->
i_del_streams
;
i
++
)
...
...
@@ -673,6 +699,7 @@ static sout_buffer_t *OggCreateFooter( sout_mux_t *p_mux, mtime_t i_dts )
p_og
=
OggStreamFlush
(
p_mux
,
&
p_sys
->
pp_del_streams
[
i
]
->
os
,
0
);
sout_BufferChain
(
&
p_hdr
,
p_og
);
ogg_stream_clear
(
&
p_sys
->
pp_del_streams
[
i
]
->
os
);
}
return
(
p_hdr
);
...
...
@@ -729,7 +756,6 @@ static int Mux( sout_mux_t *p_mux )
/* Remove deleted logical streams */
for
(
i
=
0
;
i
<
p_sys
->
i_del_streams
;
i
++
)
{
ogg_stream_clear
(
&
p_sys
->
pp_del_streams
[
i
]
->
os
);
FREE
(
p_sys
->
pp_del_streams
[
i
]
);
}
FREE
(
p_sys
->
pp_del_streams
);
...
...
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