Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
e7e1a0f3
Commit
e7e1a0f3
authored
Jan 28, 2012
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat: remove 2 chained data structures
They were only used to hold one opaque pointer
parent
3cb55949
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
37 deletions
+6
-37
modules/demux/avformat/demux.c
modules/demux/avformat/demux.c
+3
-19
modules/demux/avformat/mux.c
modules/demux/avformat/mux.c
+3
-18
No files found.
modules/demux/avformat/demux.c
View file @
e7e1a0f3
...
...
@@ -66,8 +66,6 @@ struct demux_sys_t
AVInputFormat
*
fmt
;
AVFormatContext
*
ic
;
URLContext
url
;
URLProtocol
prot
;
int
i_tk
;
es_out_id_t
**
tk
;
...
...
@@ -206,19 +204,8 @@ int OpenDemux( vlc_object_t *p_this )
/* Create I/O wrapper */
p_sys
->
io_buffer_size
=
32768
;
/* FIXME */
p_sys
->
io_buffer
=
malloc
(
p_sys
->
io_buffer_size
);
p_sys
->
url
.
priv_data
=
p_demux
;
p_sys
->
url
.
prot
=
&
p_sys
->
prot
;
p_sys
->
url
.
prot
->
name
=
"VLC I/O wrapper"
;
p_sys
->
url
.
prot
->
url_open
=
0
;
p_sys
->
url
.
prot
->
url_read
=
(
int
(
*
)
(
URLContext
*
,
unsigned
char
*
,
int
))
IORead
;
p_sys
->
url
.
prot
->
url_write
=
0
;
p_sys
->
url
.
prot
->
url_seek
=
(
int64_t
(
*
)
(
URLContext
*
,
int64_t
,
int
))
IOSeek
;
p_sys
->
url
.
prot
->
url_close
=
0
;
p_sys
->
url
.
prot
->
next
=
0
;
init_put_byte
(
&
p_sys
->
io
,
p_sys
->
io_buffer
,
p_sys
->
io_buffer_size
,
0
,
&
p_sys
->
url
,
IORead
,
NULL
,
IOSeek
);
0
,
p_demux
,
IORead
,
NULL
,
IOSeek
);
stream_Control
(
p_demux
->
s
,
STREAM_CAN_SEEK
,
&
b_can_seek
);
if
(
!
b_can_seek
)
...
...
@@ -227,7 +214,6 @@ int OpenDemux( vlc_object_t *p_this )
when trying av_find_stream_info() trying to seek all the wrong places
init_put_byte defaults io.is_streamed=0, so thats why we set them after it
*/
p_sys
->
url
.
is_streamed
=
1
;
p_sys
->
io
.
is_streamed
=
1
;
#if defined(AVIO_SEEKABLE_NORMAL)
p_sys
->
io
.
seekable
=
0
;
...
...
@@ -899,8 +885,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
*****************************************************************************/
static
int
IORead
(
void
*
opaque
,
uint8_t
*
buf
,
int
buf_size
)
{
URLContext
*
p_url
=
opaque
;
demux_t
*
p_demux
=
p_url
->
priv_data
;
demux_t
*
p_demux
=
opaque
;
if
(
buf_size
<
0
)
return
-
1
;
int
i_ret
=
stream_Read
(
p_demux
->
s
,
buf
,
buf_size
);
return
i_ret
?
i_ret
:
-
1
;
...
...
@@ -908,8 +893,7 @@ static int IORead( void *opaque, uint8_t *buf, int buf_size )
static
int64_t
IOSeek
(
void
*
opaque
,
int64_t
offset
,
int
whence
)
{
URLContext
*
p_url
=
opaque
;
demux_t
*
p_demux
=
p_url
->
priv_data
;
demux_t
*
p_demux
=
opaque
;
int64_t
i_absolute
;
int64_t
i_size
=
stream_Size
(
p_demux
->
s
);
...
...
modules/demux/avformat/mux.c
View file @
e7e1a0f3
...
...
@@ -55,8 +55,6 @@ struct sout_mux_sys_t
uint8_t
*
io_buffer
;
AVFormatContext
*
oc
;
URLContext
url
;
URLProtocol
prot
;
bool
b_write_header
;
bool
b_error
;
...
...
@@ -131,19 +129,8 @@ int OpenMux( vlc_object_t *p_this )
/* Create I/O wrapper */
p_sys
->
io_buffer_size
=
32768
;
/* FIXME */
p_sys
->
io_buffer
=
malloc
(
p_sys
->
io_buffer_size
);
p_sys
->
url
.
priv_data
=
p_mux
;
p_sys
->
url
.
prot
=
&
p_sys
->
prot
;
p_sys
->
url
.
prot
->
name
=
"VLC I/O wrapper"
;
p_sys
->
url
.
prot
->
url_open
=
0
;
p_sys
->
url
.
prot
->
url_read
=
0
;
p_sys
->
url
.
prot
->
url_write
=
(
int
(
*
)
(
URLContext
*
,
unsigned
char
*
,
int
))
IOWrite
;
p_sys
->
url
.
prot
->
url_seek
=
(
int64_t
(
*
)
(
URLContext
*
,
int64_t
,
int
))
IOSeek
;
p_sys
->
url
.
prot
->
url_close
=
0
;
p_sys
->
url
.
prot
->
next
=
0
;
init_put_byte
(
&
p_sys
->
io
,
p_sys
->
io_buffer
,
p_sys
->
io_buffer_size
,
1
,
&
p_sys
->
url
,
NULL
,
IOWrite
,
IOSeek
);
1
,
p_mux
,
NULL
,
IOWrite
,
IOSeek
);
memset
(
ap
,
0
,
sizeof
(
*
ap
)
);
if
(
av_set_parameters
(
p_sys
->
oc
,
ap
)
<
0
)
...
...
@@ -438,8 +425,7 @@ static int Control( sout_mux_t *p_mux, int i_query, va_list args )
*****************************************************************************/
static
int
IOWrite
(
void
*
opaque
,
uint8_t
*
buf
,
int
buf_size
)
{
URLContext
*
p_url
=
opaque
;
sout_mux_t
*
p_mux
=
p_url
->
priv_data
;
sout_mux_t
*
p_mux
=
opaque
;
int
i_ret
;
#ifdef AVFORMAT_DEBUG
...
...
@@ -458,8 +444,7 @@ static int IOWrite( void *opaque, uint8_t *buf, int buf_size )
static
int64_t
IOSeek
(
void
*
opaque
,
int64_t
offset
,
int
whence
)
{
URLContext
*
p_url
=
opaque
;
sout_mux_t
*
p_mux
=
p_url
->
priv_data
;
sout_mux_t
*
p_mux
=
opaque
;
#ifdef AVFORMAT_DEBUG
msg_Dbg
(
p_mux
,
"IOSeek offset: %"
PRId64
", whence: %i"
,
offset
,
whence
);
...
...
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