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
27ebd5cd
Commit
27ebd5cd
authored
Jan 23, 2003
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* asf: in fast/slow motion we don't play audio (unless there isn't any
video). Added some clean up.
parent
bed89e05
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
289 additions
and
241 deletions
+289
-241
modules/demux/asf/asf.c
modules/demux/asf/asf.c
+289
-241
No files found.
modules/demux/asf/asf.c
View file @
27ebd5cd
...
...
@@ -2,7 +2,7 @@
* asf.c : ASFv01 file input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: asf.c,v 1.1
6 2003/01/20 13:04:03
fenrir Exp $
* $Id: asf.c,v 1.1
7 2003/01/23 15:07:20
fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -430,43 +430,9 @@ static int Activate( vlc_object_t * p_this )
default: var = def; break;\
}
static
int
Demux
(
input_thread_t
*
p_input
)
static
int
Demux
Packet
(
input_thread_t
*
p_input
,
vlc_bool_t
b_play_audio
)
{
demux_sys_t
*
p_demux
=
p_input
->
p_demux_data
;
int
i
;
/* catch seek from user */
if
(
p_input
->
stream
.
p_selected_program
->
i_synchro_state
==
SYNCHRO_REINIT
)
{
off_t
i_offset
;
msleep
(
DEFAULT_PTS_DELAY
);
i_offset
=
ASF_TellAbsolute
(
p_input
)
-
p_demux
->
i_data_begin
;
if
(
i_offset
<
0
)
{
i_offset
=
0
;
}
/* XXX work only when i_min_data_packet_size == i_max_data_packet_size */
i_offset
+=
p_demux
->
p_fp
->
i_min_data_packet_size
-
i_offset
%
p_demux
->
p_fp
->
i_min_data_packet_size
;
ASF_SeekAbsolute
(
p_input
,
p_demux
->
i_data_begin
+
i_offset
);
p_demux
->
i_time
=
0
;
for
(
i
=
0
;
i
<
128
;
i
++
)
{
#define p_stream p_demux->stream[i]
if
(
p_stream
)
{
p_stream
->
i_time
=
0
;
}
#undef p_stream
}
p_demux
->
i_first_pts
=
-
1
;
}
for
(
i
=
0
;
i
<
10
;
i
++
)
// parse 10 packets
{
int
i_data_packet_min
=
p_demux
->
p_fp
->
i_min_data_packet_size
;
uint8_t
*
p_peek
;
int
i_skip
;
...
...
@@ -666,7 +632,17 @@ static int Demux( input_thread_t *p_input )
/* send complete packet to decoder */
if
(
p_stream
->
p_pes
->
i_pes_size
>
0
)
{
input_DecodePES
(
p_stream
->
p_es
->
p_decoder_fifo
,
p_stream
->
p_pes
);
if
(
p_stream
->
p_es
->
p_decoder_fifo
&&
(
b_play_audio
||
p_stream
->
i_cat
!=
AUDIO_ES
)
)
{
input_DecodePES
(
p_stream
->
p_es
->
p_decoder_fifo
,
p_stream
->
p_pes
);
}
else
{
input_DeletePES
(
p_input
->
p_method_data
,
p_stream
->
p_pes
);
}
p_stream
->
p_pes
=
NULL
;
}
}
...
...
@@ -738,7 +714,7 @@ static int Demux( input_thread_t *p_input )
}
}
continue
;
return
(
1
)
;
loop_error_recovery:
msg_Warn
(
p_input
,
"unsupported packet header"
);
...
...
@@ -749,7 +725,79 @@ loop_error_recovery:
}
ASF_SkipBytes
(
p_input
,
i_data_packet_min
);
}
// loop over packet
return
(
1
);
}
static
int
Demux
(
input_thread_t
*
p_input
)
{
demux_sys_t
*
p_demux
=
p_input
->
p_demux_data
;
vlc_bool_t
b_play_audio
;
int
i
;
/* catch seek from user */
if
(
p_input
->
stream
.
p_selected_program
->
i_synchro_state
==
SYNCHRO_REINIT
)
{
off_t
i_offset
;
msleep
(
DEFAULT_PTS_DELAY
);
i_offset
=
ASF_TellAbsolute
(
p_input
)
-
p_demux
->
i_data_begin
;
if
(
i_offset
<
0
)
{
i_offset
=
0
;
}
/* XXX work only when i_min_data_packet_size == i_max_data_packet_size */
i_offset
+=
p_demux
->
p_fp
->
i_min_data_packet_size
-
i_offset
%
p_demux
->
p_fp
->
i_min_data_packet_size
;
ASF_SeekAbsolute
(
p_input
,
p_demux
->
i_data_begin
+
i_offset
);
p_demux
->
i_time
=
0
;
for
(
i
=
0
;
i
<
128
;
i
++
)
{
#define p_stream p_demux->stream[i]
if
(
p_stream
)
{
p_stream
->
i_time
=
0
;
}
#undef p_stream
}
p_demux
->
i_first_pts
=
-
1
;
}
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
if
(
p_input
->
stream
.
control
.
i_rate
==
DEFAULT_RATE
)
{
b_play_audio
=
VLC_TRUE
;
}
else
{
int
i
;
b_play_audio
=
VLC_TRUE
;
for
(
i
=
0
;
i
<
128
;
i
++
)
{
if
(
p_demux
->
stream
[
i
]
&&
p_demux
->
stream
[
i
]
->
i_cat
==
VIDEO_ES
&&
p_demux
->
stream
[
i
]
->
p_es
&&
p_demux
->
stream
[
i
]
->
p_es
->
p_decoder_fifo
)
{
/* there is at least ine video track so no need to play audio */
b_play_audio
=
VLC_FALSE
;
}
}
}
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
for
(
i
=
0
;
i
<
10
;
i
++
)
// parse 10 packets
{
int
i_result
;
if
(
(
i_result
=
DemuxPacket
(
p_input
,
b_play_audio
)
)
<=
0
)
{
return
i_result
;
}
}
p_demux
->
i_time
=
-
1
;
for
(
i
=
0
;
i
<
128
;
i
++
)
{
...
...
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