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
85769f50
Commit
85769f50
authored
Jan 09, 2004
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/demux/mpeg: fixed latest changes to mpeg system demuxer (dvd playing was broken).
parent
18d00033
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
94 deletions
+73
-94
modules/demux/mpeg/private.h
modules/demux/mpeg/private.h
+0
-52
modules/demux/mpeg/ps.c
modules/demux/mpeg/ps.c
+9
-2
modules/demux/mpeg/system.c
modules/demux/mpeg/system.c
+30
-37
modules/demux/mpeg/system.h
modules/demux/mpeg/system.h
+23
-1
modules/demux/mpeg/ts.c
modules/demux/mpeg/ts.c
+11
-2
No files found.
modules/demux/mpeg/private.h
deleted
100644 → 0
View file @
18d00033
/*****************************************************************************
* system.c: helper module for TS, PS and PES management
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: private.h,v 1.1 2004/01/03 17:52:15 rocky Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Private structure
*****************************************************************************/
struct
demux_sys_t
{
module_t
*
p_module
;
mpeg_demux_t
mpeg
;
/*
rocky:
i_cur_mux_rate and cur_scr_time below are a bit of a hack.
Background: VLC uses the System Clock Reference (SCR) of a PACK
header to read the stream at the right pace (contrary to other
players like xine/mplayer which don't use this info and
synchronise everything on the audio output clock).
The popular SVCD/VCD subtitling WinSubMux does not renumber the
SCRs when merging subtitles into the PES. Perhaps other
multipliexing tools are equally faulty. Until such time as
WinSubMux is fixed or other tools become available and widely
used, we will cater to the WinSubMux kind of buggy stream. The
hack here delays using the PACK SCR until the first PES that
would need it is received. For this we need to temporarily save
this information in the variables below.
*/
uint32_t
i_cur_mux_rate
;
mtime_t
cur_scr_time
;
};
modules/demux/mpeg/ps.c
View file @
85769f50
...
...
@@ -2,7 +2,7 @@
* ps.c : Program Stream input module for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: ps.c,v 1.1
4 2004/01/03 17:52:15 rocky
Exp $
* $Id: ps.c,v 1.1
5 2004/01/09 00:30:29 gbazin
Exp $
*
* Author: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -36,7 +36,14 @@
*****************************************************************************/
#define PS_READ_ONCE 50
#include "private.h"
/*****************************************************************************
* Private structure
*****************************************************************************/
struct
demux_sys_t
{
module_t
*
p_module
;
mpeg_demux_t
mpeg
;
};
/*****************************************************************************
* Local prototypes
...
...
modules/demux/mpeg/system.c
View file @
85769f50
...
...
@@ -2,7 +2,7 @@
* system.c: helper module for TS, PS and PES management
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: system.c,v 1.2
7 2004/01/03 17:52:15 rocky
Exp $
* $Id: system.c,v 1.2
8 2004/01/09 00:30:29 gbazin
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr>
...
...
@@ -34,7 +34,6 @@
#include <vlc/input.h>
#include "system.h"
#include "private.h"
/*****************************************************************************
* Local prototypes
...
...
@@ -63,18 +62,11 @@ vlc_module_end();
*****************************************************************************/
static
int
Activate
(
vlc_object_t
*
p_this
)
{
input_thread_t
*
p_input
=
(
input_thread_t
*
)
p_this
;
demux_sys_t
*
p_sys
=
p_input
->
p_demux_data
;
static
mpeg_demux_t
mpeg_demux
=
{
NULL
,
ReadPS
,
ParsePS
,
DemuxPS
,
ReadTS
,
DemuxTS
};
mpeg_demux
.
cur_scr_time
=
-
1
;
memcpy
(
p_this
->
p_private
,
&
mpeg_demux
,
sizeof
(
mpeg_demux
)
);
if
(
!
p_sys
)
return
VLC_EGENERIC
;
p_sys
->
cur_scr_time
=
-
1
;
return
VLC_SUCCESS
;
}
...
...
@@ -569,15 +561,15 @@ static uint16_t GetID( input_thread_t *p_input, data_packet_t * p_data )
i_id
=
p_data
->
p_demux_start
[
3
];
/* stream_id */
if
(
i_id
==
0xBD
)
{
demux_sys_t
*
p_sys
=
p_input
->
p_demux_data
;
mpeg_demux_t
*
p_mpeg_demux
=
(
mpeg_demux_t
*
)
p_input
->
p_private
;
/* FIXME : this is not valid if the header is split in multiple
* packets */
/* stream_private_id */
i_id
|=
p_data
->
p_demux_start
[
9
+
p_data
->
p_demux_start
[
8
]
]
<<
8
;
/* FIXME: See note about cur_scr_time above. */
p_sys
->
cur_scr_time
=
-
1
;
/* FIXME: See note about cur_scr_time above. */
p_mpeg_demux
->
cur_scr_time
=
-
1
;
}
return
(
i_id
);
}
...
...
@@ -983,7 +975,7 @@ static es_descriptor_t * ParsePS( input_thread_t * p_input,
/* SVCD OGT subtitles in stream 0x070 */
i_fourcc
=
VLC_FOURCC
(
'o'
,
'g'
,
't'
,
' '
);
i_cat
=
SPU_ES
;
b_auto_spawn
=
VLC_TRUE
;
b_auto_spawn
=
VLC_TRUE
;
}
else
if
(
((
i_id
>>
8
)
&
0xFF
)
<=
0x03
&&
(
i_id
&
0x00FF
)
==
0x00BD
)
...
...
@@ -991,7 +983,7 @@ static es_descriptor_t * ParsePS( input_thread_t * p_input,
/* CVD subtitles (0x00->0x03) */
i_fourcc
=
VLC_FOURCC
(
'c'
,
'v'
,
'd'
,
' '
);
i_cat
=
SPU_ES
;
b_auto_spawn
=
VLC_TRUE
;
b_auto_spawn
=
VLC_TRUE
;
}
else
{
...
...
@@ -1025,7 +1017,7 @@ static void DemuxPS( input_thread_t * p_input, data_packet_t * p_data )
uint32_t
i_code
;
vlc_bool_t
b_trash
=
0
;
es_descriptor_t
*
p_es
=
NULL
;
demux_sys_t
*
p_sys
=
p_input
->
p_demux_data
;
mpeg_demux_t
*
p_mpeg_demux
=
(
mpeg_demux_t
*
)
p_input
->
p_private
;
i_code
=
((
uint32_t
)
p_data
->
p_demux_start
[
0
]
<<
24
)
|
((
uint32_t
)
p_data
->
p_demux_start
[
1
]
<<
16
)
...
...
@@ -1096,8 +1088,8 @@ static void DemuxPS( input_thread_t * p_input, data_packet_t * p_data )
/* mux_rate */
i_mux_rate
=
(
U32_AT
(
p_header
+
8
)
&
0x7FFFFE
)
>>
1
;
}
p_sys
->
cur_scr_time
=
scr_time
;
p_sys
->
i_cur_mux_rate
=
i_mux_rate
;
p_mpeg_demux
->
cur_scr_time
=
scr_time
;
p_mpeg_demux
->
i_cur_mux_rate
=
i_mux_rate
;
b_trash
=
1
;
}
...
...
@@ -1127,25 +1119,26 @@ static void DemuxPS( input_thread_t * p_input, data_packet_t * p_data )
{
p_es
=
ParsePS
(
p_input
,
p_data
);
/* Call the pace control.
FIXME: see hack note about cur_scr_time above.
*/
if
(
p_sys
->
cur_scr_time
!=
-
1
)
{
input_ClockManageRef
(
p_input
,
p_input
->
stream
.
p_selected_program
,
p_sys
->
cur_scr_time
);
if
(
p_sys
->
i_cur_mux_rate
!=
p_input
->
stream
.
i_mux_rate
&&
p_input
->
stream
.
i_mux_rate
)
{
msg_Warn
(
p_input
,
"mux_rate changed prev: %ud, cur: %ud;"
" expect cosmetic errors"
,
(
unsigned
int
)
p_input
->
stream
.
i_mux_rate
,
(
unsigned
int
)
p_sys
->
i_cur_mux_rate
);
}
p_input
->
stream
.
i_mux_rate
=
p_sys
->
i_cur_mux_rate
;
}
/* Call the pace control.
* FIXME: see hack note about cur_scr_time above.
*/
if
(
p_mpeg_demux
->
cur_scr_time
!=
-
1
)
{
input_ClockManageRef
(
p_input
,
p_input
->
stream
.
p_selected_program
,
p_mpeg_demux
->
cur_scr_time
);
if
(
p_mpeg_demux
->
i_cur_mux_rate
!=
p_input
->
stream
.
i_mux_rate
&&
p_input
->
stream
.
i_mux_rate
)
{
msg_Warn
(
p_input
,
"mux_rate changed prev: %ud, cur: %ud;"
" expect cosmetic errors"
,
(
unsigned
int
)
p_input
->
stream
.
i_mux_rate
,
(
unsigned
int
)
p_mpeg_demux
->
i_cur_mux_rate
);
}
p_input
->
stream
.
i_mux_rate
=
p_mpeg_demux
->
i_cur_mux_rate
;
}
vlc_mutex_lock
(
&
p_input
->
stream
.
control
.
control_lock
);
if
(
p_es
!=
NULL
&&
p_es
->
p_dec
!=
NULL
&&
(
p_es
->
i_cat
!=
AUDIO_ES
||
!
p_input
->
stream
.
control
.
b_mute
)
)
...
...
modules/demux/mpeg/system.h
View file @
85769f50
...
...
@@ -2,7 +2,7 @@
* system.h: MPEG demultiplexing.
*****************************************************************************
* Copyright (C) 1999-2002 VideoLAN
* $Id: system.h,v 1.1
2 2003/11/06 16:36:41 nitrox
Exp $
* $Id: system.h,v 1.1
3 2004/01/09 00:30:29 gbazin
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -104,6 +104,28 @@ typedef struct mpeg_demux_t
ssize_t
(
*
pf_read_ts
)
(
input_thread_t
*
,
data_packet_t
**
);
void
(
*
pf_demux_ts
)
(
input_thread_t
*
,
data_packet_t
*
,
psi_callback_t
);
/*
rocky:
i_cur_mux_rate and cur_scr_time below are a bit of a hack.
Background: VLC uses the System Clock Reference (SCR) of a PACK
header to read the stream at the right pace (contrary to other
players like xine/mplayer which don't use this info and
synchronise everything on the audio output clock).
The popular SVCD/VCD subtitling WinSubMux does not renumber the
SCRs when merging subtitles into the PES. Perhaps other
multipliexing tools are equally faulty. Until such time as
WinSubMux is fixed or other tools become available and widely
used, we will cater to the WinSubMux kind of buggy stream. The
hack here delays using the PACK SCR until the first PES that
would need it is received. For this we need to temporarily save
this information in the variables below.
*/
uint32_t
i_cur_mux_rate
;
mtime_t
cur_scr_time
;
}
mpeg_demux_t
;
/*****************************************************************************
...
...
modules/demux/mpeg/ts.c
View file @
85769f50
...
...
@@ -2,7 +2,7 @@
* mpeg_ts.c : Transport Stream input module for vlc
*****************************************************************************
* Copyright (C) 2000, 2001, 2003 VideoLAN
* $Id: ts.c,v 1.4
3 2004/01/03 17:52:15 rocky
Exp $
* $Id: ts.c,v 1.4
4 2004/01/09 00:30:29 gbazin
Exp $
*
* Authors: Henri Fallon <henri@via.ecp.fr>
* Johan Bilien <jobi@via.ecp.fr>
...
...
@@ -49,13 +49,22 @@
#include "system.h"
#include "codecs.h"
#include "private.h"
/*****************************************************************************
* Constants
*****************************************************************************/
#define TS_READ_ONCE 200
/*****************************************************************************
* Private structure
*****************************************************************************/
struct
demux_sys_t
{
module_t
*
p_module
;
mpeg_demux_t
mpeg
;
};
#define local_iso639_getlang(p1, p2) \
{ \
const iso639_lang_t * p_iso; \
...
...
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