Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
33c859c1
Commit
33c859c1
authored
Jan 20, 2014
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf: ignore attachment streams for interleaving purposes
Those streams should never get any packets by definition.
parent
7b03b65b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
1 deletion
+28
-1
avformat.h
libavformat/avformat.h
+7
-0
internal.h
libavformat/internal.h
+8
-0
mux.c
libavformat/mux.c
+4
-1
options.c
libavformat/options.c
+8
-0
utils.c
libavformat/utils.c
+1
-0
No files found.
libavformat/avformat.h
View file @
33c859c1
...
@@ -796,6 +796,8 @@ typedef struct AVChapter {
...
@@ -796,6 +796,8 @@ typedef struct AVChapter {
AVDictionary
*
metadata
;
AVDictionary
*
metadata
;
}
AVChapter
;
}
AVChapter
;
typedef
struct
AVFormatInternal
AVFormatInternal
;
/**
/**
* Format I/O context.
* Format I/O context.
* New fields can be added to the end with minor version bumps.
* New fields can be added to the end with minor version bumps.
...
@@ -1049,6 +1051,11 @@ typedef struct AVFormatContext {
...
@@ -1049,6 +1051,11 @@ typedef struct AVFormatContext {
*/
*/
AVRational
offset_timebase
;
AVRational
offset_timebase
;
/**
* An opaque field for libavformat internal usage.
* Must not be accessed in any way by callers.
*/
AVFormatInternal
*
internal
;
}
AVFormatContext
;
}
AVFormatContext
;
typedef
struct
AVPacketList
{
typedef
struct
AVPacketList
{
...
...
libavformat/internal.h
View file @
33c859c1
...
@@ -42,6 +42,14 @@ typedef struct CodecMime{
...
@@ -42,6 +42,14 @@ typedef struct CodecMime{
enum
AVCodecID
id
;
enum
AVCodecID
id
;
}
CodecMime
;
}
CodecMime
;
struct
AVFormatInternal
{
/**
* Number of streams relevant for interleaving.
* Muxing only.
*/
int
nb_interleaved_streams
;
};
void
ff_dynarray_add
(
intptr_t
**
tab_ptr
,
int
*
nb_ptr
,
intptr_t
elem
);
void
ff_dynarray_add
(
intptr_t
**
tab_ptr
,
int
*
nb_ptr
,
intptr_t
elem
);
#ifdef __GNUC__
#ifdef __GNUC__
...
...
libavformat/mux.c
View file @
33c859c1
...
@@ -232,6 +232,9 @@ static int init_muxer(AVFormatContext *s, AVDictionary **options)
...
@@ -232,6 +232,9 @@ static int init_muxer(AVFormatContext *s, AVDictionary **options)
av_log
(
s
,
AV_LOG_WARNING
,
av_log
(
s
,
AV_LOG_WARNING
,
"Codec for stream %d does not use global headers "
"Codec for stream %d does not use global headers "
"but container format requires global headers
\n
"
,
i
);
"but container format requires global headers
\n
"
,
i
);
if
(
codec
->
codec_type
!=
AVMEDIA_TYPE_ATTACHMENT
)
s
->
internal
->
nb_interleaved_streams
++
;
}
}
if
(
!
s
->
priv_data
&&
of
->
priv_data_size
>
0
)
{
if
(
!
s
->
priv_data
&&
of
->
priv_data_size
>
0
)
{
...
@@ -541,7 +544,7 @@ int ff_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out,
...
@@ -541,7 +544,7 @@ int ff_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out,
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
stream_count
+=
!!
s
->
streams
[
i
]
->
last_in_packet_buffer
;
stream_count
+=
!!
s
->
streams
[
i
]
->
last_in_packet_buffer
;
if
(
stream_count
&&
(
s
->
nb
_streams
==
stream_count
||
flush
))
{
if
(
stream_count
&&
(
s
->
internal
->
nb_interleaved
_streams
==
stream_count
||
flush
))
{
pktl
=
s
->
packet_buffer
;
pktl
=
s
->
packet_buffer
;
*
out
=
pktl
->
pkt
;
*
out
=
pktl
->
pkt
;
...
...
libavformat/options.c
View file @
33c859c1
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
*/
*/
#include "avformat.h"
#include "avformat.h"
#include "avio_internal.h"
#include "avio_internal.h"
#include "internal.h"
#include "libavutil/opt.h"
#include "libavutil/opt.h"
/**
/**
...
@@ -100,6 +101,13 @@ AVFormatContext *avformat_alloc_context(void)
...
@@ -100,6 +101,13 @@ AVFormatContext *avformat_alloc_context(void)
ic
=
av_malloc
(
sizeof
(
AVFormatContext
));
ic
=
av_malloc
(
sizeof
(
AVFormatContext
));
if
(
!
ic
)
return
ic
;
if
(
!
ic
)
return
ic
;
avformat_get_context_defaults
(
ic
);
avformat_get_context_defaults
(
ic
);
ic
->
internal
=
av_mallocz
(
sizeof
(
*
ic
->
internal
));
if
(
!
ic
->
internal
)
{
avformat_free_context
(
ic
);
return
NULL
;
}
return
ic
;
return
ic
;
}
}
...
...
libavformat/utils.c
View file @
33c859c1
...
@@ -2633,6 +2633,7 @@ void avformat_free_context(AVFormatContext *s)
...
@@ -2633,6 +2633,7 @@ void avformat_free_context(AVFormatContext *s)
av_freep
(
&
s
->
chapters
);
av_freep
(
&
s
->
chapters
);
av_dict_free
(
&
s
->
metadata
);
av_dict_free
(
&
s
->
metadata
);
av_freep
(
&
s
->
streams
);
av_freep
(
&
s
->
streams
);
av_freep
(
&
s
->
internal
);
av_free
(
s
);
av_free
(
s
);
}
}
...
...
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