Commit d75d16cb authored by Jean-Paul Saman's avatar Jean-Paul Saman

debian: patches: add splice point generation fixes.

Add patches for generating proper splice points in the adaptation field for
AUDIO and VIDEO elementary streams.
parent 5b2cfac6
diff --git a/modules/mux/mpeg/ts.c b/modules/mux/mpeg/ts.c
index 7e349e1..dc95ecd 100644
--- a/modules/mux/mpeg/ts.c
+++ b/modules/mux/mpeg/ts.c
@@ -979,7 +979,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
p_stream->i_codec = p_input->p_fmt->i_codec;
p_stream->i_continuity_counter = 0;
p_stream->b_discontinuity = false;
- p_stream->b_splicing_point = true;
+ p_stream->b_splicing_point = false;
p_stream->i_splice_countdown = 0;
p_stream->i_decoder_specific_info = 0;
p_stream->p_decoder_specific_info = NULL;
@@ -1034,6 +1034,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
free( p_stream );
return VLC_EGENERIC;
}
+ p_stream->b_splicing_point = true;
p_sys->i_video_bound++;
break;
@@ -1074,6 +1075,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
free( p_stream );
return VLC_EGENERIC;
}
+ p_stream->b_splicing_point = true;
p_sys->i_audio_bound++;
break;
@@ -1173,7 +1175,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
p_stream->lang[i*3+0] = pl->psz_iso639_2T[0];
p_stream->lang[i*3+1] = pl->psz_iso639_2T[1];
p_stream->lang[i*3+2] = pl->psz_iso639_2T[2];
-
+
msg_Dbg( p_mux, " - lang=%c%c%c",
p_stream->lang[i*3+0], p_stream->lang[i*3+1],
p_stream->lang[i*3+2] );
@@ -2077,8 +2079,8 @@ static block_t *TSNew( sout_mux_t *p_mux, ts_stream_t *p_stream,
/* in (+) or out (-) point */
p_ts->p_buffer[12] = p_stream->i_splice_countdown > 0 ?
(0x80 | (p_stream->i_splice_countdown & 0x7f)) : 0;
- p_stream->b_splicing_point = !(p_stream->i_splice_countdown == 127);
p_stream->i_splice_countdown++;
+ p_stream->b_splicing_point = (p_stream->i_splice_countdown >= 127) ? false : true;
}
for( i = i_stuffing_start; i < i_stuffing_start + i_stuffing; i++ )
@@ -2101,7 +2103,7 @@ static block_t *TSNew( sout_mux_t *p_mux, ts_stream_t *p_stream,
/* in (+) or out (-) point */
p_ts->p_buffer[6] = p_stream->i_splice_countdown > 0 ?
(0x80 | (p_stream->i_splice_countdown & 0x7f)) : 0;
- p_stream->b_splicing_point = !(p_stream->i_splice_countdown == 127);
+ p_stream->b_splicing_point = (p_stream->i_splice_countdown >= 127) ? false : true;
p_stream->i_splice_countdown++;
}
--
1.7.2.3
diff --git a/modules/mux/mpeg/ts.c b/modules/mux/mpeg/ts.c
index dc95ecd..e3b8c04 100644
--- a/modules/mux/mpeg/ts.c
+++ b/modules/mux/mpeg/ts.c
@@ -2094,19 +2094,19 @@ static block_t *TSNew( sout_mux_t *p_mux, ts_stream_t *p_stream,
int i_stuffing_start = b_splicing_point ? 7 : 6;
p_ts->p_buffer[4] = i_stuffing + (b_splicing_point ? 2 : -1);
- if( i_stuffing > 1 )
+ p_ts->p_buffer[5] = 0x00;
+ if( b_splicing_point )
{
- p_ts->p_buffer[5] = 0x00;
- if( b_splicing_point )
- {
- p_ts->p_buffer[5] |= 0x04; /* flag splicing point */
- /* in (+) or out (-) point */
- p_ts->p_buffer[6] = p_stream->i_splice_countdown > 0 ?
- (0x80 | (p_stream->i_splice_countdown & 0x7f)) : 0;
- p_stream->b_splicing_point = (p_stream->i_splice_countdown >= 127) ? false : true;
- p_stream->i_splice_countdown++;
- }
+ p_ts->p_buffer[5] |= 0x04; /* flag splicing point */
+ /* in (+) or out (-) point */
+ p_ts->p_buffer[6] = p_stream->i_splice_countdown > 0 ?
+ (0x80 | (p_stream->i_splice_countdown & 0x7f)) : 0;
+ p_stream->b_splicing_point = (p_stream->i_splice_countdown >= 127) ? false : true;
+ p_stream->i_splice_countdown++;
+ }
+ if( i_stuffing > 1 )
+ {
for( i = i_stuffing_start; i < i_stuffing_start + i_stuffing; i++ )
{
p_ts->p_buffer[i] = 0xff;
--
1.7.2.3
......@@ -18,3 +18,5 @@
#CVE-2010-2937.patch
901-modules-codec-x264.c-relax-requirement-to-X264_BUILD.patch
0001-mux-mpeg-ts.c-Generate-splice-points.patch
0002-mux-mpeg-ts.c-splice_point-generation-fixes.patch
0003-mux-mpeg-ts.c-write-splice_countdown-field-when-no-p.patch
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment