Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
7932c484
Commit
7932c484
authored
Oct 30, 2005
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ALL: backport of 13027,13033,13034,13039,13040,13041 from trunk
parent
972d15ae
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
39 deletions
+56
-39
modules/access/rtsp/real_rmff.c
modules/access/rtsp/real_rmff.c
+9
-4
modules/codec/ffmpeg/demux.c
modules/codec/ffmpeg/demux.c
+21
-21
modules/codec/ffmpeg/ffmpeg.c
modules/codec/ffmpeg/ffmpeg.c
+15
-2
modules/codec/vorbis.c
modules/codec/vorbis.c
+1
-1
modules/demux/mp4/mp4.c
modules/demux/mp4/mp4.c
+2
-0
modules/demux/real.c
modules/demux/real.c
+8
-11
No files found.
modules/access/rtsp/real_rmff.c
View file @
7932c484
...
...
@@ -505,7 +505,7 @@ void rmff_fix_header(rmff_header_t *h) {
memset
(
h
->
data
,
0
,
sizeof
(
rmff_data_t
));
h
->
data
->
object_id
=
DATA_TAG
;
h
->
data
->
object_version
=
0
;
h
->
data
->
size
=
34
;
h
->
data
->
size
=
18
;
h
->
data
->
num_packets
=
0
;
h
->
data
->
next_data_header
=
0
;
}
...
...
@@ -518,7 +518,7 @@ void rmff_fix_header(rmff_header_t *h) {
if
(
h
->
fileheader
)
{
memset
(
h
->
fileheader
,
0
,
sizeof
(
rmff_fileheader_t
));
h
->
fileheader
->
object_id
=
RMF_TAG
;
h
->
fileheader
->
size
=
34
;
h
->
fileheader
->
size
=
18
;
h
->
fileheader
->
object_version
=
0
;
h
->
fileheader
->
file_version
=
0
;
h
->
fileheader
->
num_headers
=
num_headers
+
1
;
...
...
@@ -536,6 +536,9 @@ void rmff_fix_header(rmff_header_t *h) {
lprintf
(
"rmff_fix_header: setting prop.data_offset from %i to %i
\n
"
,
h
->
prop
->
data_offset
,
header_size
);
h
->
prop
->
data_offset
=
header_size
;
}
/* FIXME: I doubt this is right to do this here.
* It should belong to the demux. */
if
(
h
->
prop
->
num_packets
==
0
)
{
int
p
=
(
int
)(
h
->
prop
->
avg_bit_rate
/
8
.
0
*
(
h
->
prop
->
duration
/
1000
.
0
)
/
h
->
prop
->
avg_packet_size
);
lprintf
(
"rmff_fix_header: assuming prop.num_packets=%i
\n
"
,
p
);
...
...
@@ -545,8 +548,10 @@ void rmff_fix_header(rmff_header_t *h) {
lprintf
(
"rmff_fix_header: assuming data.num_packets=%i
\n
"
,
h
->
prop
->
num_packets
);
h
->
data
->
num_packets
=
h
->
prop
->
num_packets
;
}
lprintf
(
"rmff_fix_header: assuming data.size=%i
\n
"
,
h
->
prop
->
num_packets
*
h
->
prop
->
avg_packet_size
);
h
->
data
->
size
=
h
->
prop
->
num_packets
*
h
->
prop
->
avg_packet_size
;
if
(
h
->
data
->
size
==
18
||
!
h
->
data
->
size
)
{
lprintf
(
"rmff_fix_header: assuming data.size=%i
\n
"
,
h
->
prop
->
num_packets
*
h
->
prop
->
avg_packet_size
);
h
->
data
->
size
+=
h
->
prop
->
num_packets
*
h
->
prop
->
avg_packet_size
;
}
}
}
...
...
modules/codec/ffmpeg/demux.c
View file @
7932c484
...
...
@@ -43,11 +43,7 @@
//#define AVFORMAT_DEBUG 1
/* Version checking */
#if (LIBAVFORMAT_BUILD >= 4611) && defined(HAVE_LIBAVFORMAT)
#if LIBAVFORMAT_BUILD < 4619
# define av_seek_frame(a,b,c,d) av_seek_frame(a,b,c)
#endif
#if (LIBAVFORMAT_BUILD >= 4629) && defined(HAVE_LIBAVFORMAT)
/*****************************************************************************
* demux_sys_t: demux descriptor
...
...
@@ -180,7 +176,7 @@ int E_(OpenDemux)( vlc_object_t *p_this )
return
VLC_EGENERIC
;
}
if
(
av_find_stream_info
(
p_sys
->
ic
)
)
if
(
av_find_stream_info
(
p_sys
->
ic
)
<
0
)
{
msg_Err
(
p_demux
,
"av_find_stream_info failed"
);
E_
(
CloseDemux
)(
p_this
);
...
...
@@ -189,7 +185,7 @@ int E_(OpenDemux)( vlc_object_t *p_this )
for
(
i
=
0
;
i
<
p_sys
->
ic
->
nb_streams
;
i
++
)
{
AVCodecContext
*
cc
=
&
p_sys
->
ic
->
streams
[
i
]
->
codec
;
AVCodecContext
*
cc
=
p_sys
->
ic
->
streams
[
i
]
->
codec
;
es_out_id_t
*
es
;
es_format_t
fmt
;
vlc_fourcc_t
fcc
;
...
...
@@ -234,10 +230,10 @@ int E_(OpenDemux)( vlc_object_t *p_this )
msg_Dbg
(
p_demux
,
" - format = %s (%s)"
,
p_sys
->
fmt
->
name
,
p_sys
->
fmt
->
long_name
);
msg_Dbg
(
p_demux
,
" - start time = "
I64Fd
,
(
p_sys
->
ic
->
start_time
!=
(
signed
int
)
AV_NOPTS_VALUE
)
?
(
p_sys
->
ic
->
start_time
!=
AV_NOPTS_VALUE
)
?
p_sys
->
ic
->
start_time
*
1000000
/
AV_TIME_BASE
:
-
1
);
msg_Dbg
(
p_demux
,
" - duration = "
I64Fd
,
(
p_sys
->
ic
->
duration
!=
(
signed
int
)
AV_NOPTS_VALUE
)
?
(
p_sys
->
ic
->
duration
!=
AV_NOPTS_VALUE
)
?
p_sys
->
ic
->
duration
*
1000000
/
AV_TIME_BASE
:
-
1
);
return
VLC_SUCCESS
;
...
...
@@ -283,13 +279,17 @@ static int Demux( demux_t *p_demux )
memcpy
(
p_frame
->
p_buffer
,
pkt
.
data
,
pkt
.
size
);
i_start_time
=
(
p_sys
->
ic
->
start_time
!=
(
signed
int
)
AV_NOPTS_VALUE
)
?
i_start_time
=
(
p_sys
->
ic
->
start_time
!=
AV_NOPTS_VALUE
)
?
p_sys
->
ic
->
start_time
:
0
;
p_frame
->
i_dts
=
(
pkt
.
dts
==
(
signed
int
)
AV_NOPTS_VALUE
)
?
0
:
(
pkt
.
dts
-
i_start_time
)
*
1000000
/
AV_TIME_BASE
;
p_frame
->
i_pts
=
(
pkt
.
pts
==
(
signed
int
)
AV_NOPTS_VALUE
)
?
0
:
(
pkt
.
pts
-
i_start_time
)
*
1000000
/
AV_TIME_BASE
;
p_frame
->
i_dts
=
(
pkt
.
dts
==
AV_NOPTS_VALUE
)
?
0
:
(
pkt
.
dts
-
i_start_time
)
*
1000000
*
p_sys
->
ic
->
streams
[
pkt
.
stream_index
]
->
time_base
.
num
/
p_sys
->
ic
->
streams
[
pkt
.
stream_index
]
->
time_base
.
den
;
p_frame
->
i_pts
=
(
pkt
.
pts
==
AV_NOPTS_VALUE
)
?
0
:
(
pkt
.
pts
-
i_start_time
)
*
1000000
*
p_sys
->
ic
->
streams
[
pkt
.
stream_index
]
->
time_base
.
num
/
p_sys
->
ic
->
streams
[
pkt
.
stream_index
]
->
time_base
.
den
;
#ifdef AVFORMAT_DEBUG
msg_Dbg
(
p_demux
,
"tk[%d] dts="
I64Fd
" pts="
I64Fd
,
...
...
@@ -300,7 +300,7 @@ static int Demux( demux_t *p_demux )
(
pkt
.
stream_index
==
p_sys
->
i_pcr_tk
||
p_sys
->
i_pcr_tk
<
0
)
)
{
p_sys
->
i_pcr_tk
=
pkt
.
stream_index
;
p_sys
->
i_pcr
=
p
kt
.
dts
-
i_start_time
;
p_sys
->
i_pcr
=
p
_frame
->
i_dts
;
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_PCR
,
(
int64_t
)
p_sys
->
i_pcr
);
}
...
...
@@ -329,7 +329,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
*
pf
=
(
double
)
stream_Tell
(
p_demux
->
s
)
/
(
double
)
i64
;
}
if
(
p_sys
->
ic
->
duration
!=
(
signed
int
)
AV_NOPTS_VALUE
&&
p_sys
->
i_pcr
>
0
)
if
(
p_sys
->
ic
->
duration
!=
AV_NOPTS_VALUE
&&
p_sys
->
i_pcr
>
0
)
{
*
pf
=
(
double
)
p_sys
->
i_pcr
/
(
double
)
p_sys
->
ic
->
duration
;
}
...
...
@@ -344,10 +344,10 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
int64_t
i_size
=
stream_Size
(
p_demux
->
s
);
i64
=
p_sys
->
i_pcr
*
i_size
/
i64
*
f
;
if
(
p_sys
->
ic
->
start_time
!=
(
signed
int
)
AV_NOPTS_VALUE
)
if
(
p_sys
->
ic
->
start_time
!=
AV_NOPTS_VALUE
)
i64
+=
p_sys
->
ic
->
start_time
;
if
(
p_sys
->
ic
->
duration
!=
(
signed
int
)
AV_NOPTS_VALUE
)
if
(
p_sys
->
ic
->
duration
!=
AV_NOPTS_VALUE
)
i64
=
p_sys
->
ic
->
duration
*
f
;
msg_Warn
(
p_demux
,
"DEMUX_SET_POSITION: "
I64Fd
,
i64
);
...
...
@@ -363,7 +363,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
case
DEMUX_GET_LENGTH
:
pi64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
if
(
p_sys
->
ic
->
duration
!=
(
signed
int
)
AV_NOPTS_VALUE
)
if
(
p_sys
->
ic
->
duration
!=
AV_NOPTS_VALUE
)
{
*
pi64
=
p_sys
->
ic
->
duration
;
}
...
...
@@ -377,7 +377,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
case
DEMUX_SET_TIME
:
i64
=
(
int64_t
)
va_arg
(
args
,
int64_t
);
if
(
p_sys
->
ic
->
start_time
!=
(
signed
int
)
AV_NOPTS_VALUE
)
if
(
p_sys
->
ic
->
start_time
!=
AV_NOPTS_VALUE
)
i64
+=
p_sys
->
ic
->
start_time
;
msg_Warn
(
p_demux
,
"DEMUX_SET_TIME: "
I64Fd
,
i64
);
...
...
@@ -478,4 +478,4 @@ void E_(CloseDemux)( vlc_object_t *p_this )
{
}
#endif
/* LIBAVFORMAT_BUILD >= 46
11
*/
#endif
/* LIBAVFORMAT_BUILD >= 46
29
*/
modules/codec/ffmpeg/ffmpeg.c
View file @
7932c484
...
...
@@ -336,10 +336,20 @@ static void LibavcodecCallback( void *p_opaque, int i_level,
char
*
psz_new_format
;
const
char
*
psz_item_name
;
if
(
p_avctx
==
NULL
||
p_avctx
->
opaque
==
NULL
)
p_avc
=
p_avctx
?
p_avctx
->
av_class
:
0
;
#define cln p_avc->class_name
/* Make sure we can get p_this back */
if
(
!
p_avctx
||
!
p_avc
||
!
cln
||
cln
[
0
]
!=
'A'
||
cln
[
1
]
!=
'V'
||
cln
[
2
]
!=
'C'
||
cln
[
3
]
!=
'o'
||
cln
[
4
]
!=
'd'
||
cln
[
5
]
!=
'e'
||
cln
[
6
]
!=
'c'
)
{
if
(
i_level
==
AV_LOG_ERROR
)
vfprintf
(
stderr
,
psz_format
,
va
);
return
;
}
#undef cln
p_this
=
(
vlc_object_t
*
)
p_avctx
->
opaque
;
p_avc
=
p_avctx
->
av_class
;
switch
(
i_level
)
{
...
...
@@ -831,6 +841,9 @@ static struct
#endif
#if LIBAVCODEC_BUILD >= 4752
{
VLC_FOURCC
(
'r'
,
'l'
,
'e'
,
' '
),
CODEC_ID_QTRLE
,
VIDEO_ES
,
"Apple QuickTime RLE Video"
},
{
VLC_FOURCC
(
'q'
,
'd'
,
'r'
,
'w'
),
CODEC_ID_QDRAW
,
VIDEO_ES
,
"Apple QuickDraw Video"
},
...
...
modules/codec/vorbis.c
View file @
7932c484
...
...
@@ -709,7 +709,7 @@ static void CloseDecoder( vlc_object_t *p_this )
decoder_t
*
p_dec
=
(
decoder_t
*
)
p_this
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
if
(
!
p_sys
->
b_packetizer
&&
p_sys
->
i_headers
>
=
3
)
if
(
!
p_sys
->
b_packetizer
&&
p_sys
->
i_headers
>
3
)
{
vorbis_block_clear
(
&
p_sys
->
vb
);
vorbis_dsp_clear
(
&
p_sys
->
vd
);
...
...
modules/demux/mp4/mp4.c
View file @
7932c484
...
...
@@ -1427,6 +1427,8 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
case
(
VIDEO_ES
):
p_track
->
fmt
.
video
.
i_width
=
p_sample
->
data
.
p_sample_vide
->
i_width
;
p_track
->
fmt
.
video
.
i_height
=
p_sample
->
data
.
p_sample_vide
->
i_height
;
p_track
->
fmt
.
video
.
i_bits_per_pixel
=
p_sample
->
data
.
p_sample_vide
->
i_depth
;
/* fall on display size */
if
(
p_track
->
fmt
.
video
.
i_width
<=
0
)
...
...
modules/demux/real.c
View file @
7932c484
...
...
@@ -100,6 +100,7 @@ static int Open( vlc_object_t *p_this )
p_demux
->
pf_demux
=
Demux
;
p_demux
->
pf_control
=
Control
;
p_demux
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
demux_sys_t
)
);
memset
(
p_sys
,
0
,
sizeof
(
demux_sys_t
)
);
p_sys
->
i_data_offset
=
0
;
p_sys
->
i_track
=
0
;
p_sys
->
track
=
NULL
;
...
...
@@ -175,9 +176,9 @@ static int Demux( demux_t *p_demux )
real_track_t
*
tk
=
NULL
;
vlc_bool_t
b_selected
;
if
(
p_sys
->
i_data_packets
>=
p_sys
->
i_data_packets_count
)
if
(
p_sys
->
i_data_packets
>=
p_sys
->
i_data_packets_count
&&
p_sys
->
i_data_packets_count
)
{
if
(
stream_Read
(
p_demux
->
s
,
header
,
18
)
<
18
)
{
return
0
;
...
...
@@ -602,7 +603,11 @@ static int HeaderRead( demux_t *p_demux )
msg_Dbg
(
p_demux
,
"object %4.4s size=%d version=%d"
,
(
char
*
)
&
i_id
,
i_size
,
i_version
);
if
(
i_size
<
10
)
return
VLC_EGENERIC
;
if
(
i_size
<
10
)
{
msg_Dbg
(
p_demux
,
"invalid size for object %4.4s"
,
(
char
*
)
&
i_id
);
return
VLC_EGENERIC
;
}
i_skip
=
i_size
-
10
;
if
(
i_id
==
VLC_FOURCC
(
'.'
,
'R'
,
'M'
,
'F'
)
)
...
...
@@ -923,14 +928,6 @@ static int ReadCodecSpecificData( demux_t *p_demux, int i_len, int i_num )
if
(
fmt
.
i_codec
!=
0
)
{
msg_Dbg
(
p_demux
,
" - extra data=%d"
,
fmt
.
i_extra
);
{
int
i
;
for
(
i
=
0
;
i
<
fmt
.
i_extra
;
i
++
)
{
msg_Dbg
(
p_demux
,
" data[%d] = 0x%x"
,
i
,
((
uint8_t
*
)
fmt
.
p_extra
)[
i
]
);
}
}
tk
=
malloc
(
sizeof
(
real_track_t
)
);
tk
->
i_id
=
i_num
;
...
...
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