Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
a5d42043
Commit
a5d42043
authored
Oct 23, 2015
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat: Always return ref-counted AVPacket
And drop the av_dup_packet from the input_thread.
parent
f0ca6ffa
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
avconv.c
avconv.c
+0
-1
avplay.c
avplay.c
+0
-4
utils.c
libavformat/utils.c
+8
-0
No files found.
avconv.c
View file @
a5d42043
...
@@ -2130,7 +2130,6 @@ static void *input_thread(void *arg)
...
@@ -2130,7 +2130,6 @@ static void *input_thread(void *arg)
while
(
!
av_fifo_space
(
f
->
fifo
))
while
(
!
av_fifo_space
(
f
->
fifo
))
pthread_cond_wait
(
&
f
->
fifo_cond
,
&
f
->
fifo_lock
);
pthread_cond_wait
(
&
f
->
fifo_cond
,
&
f
->
fifo_lock
);
av_dup_packet
(
&
pkt
);
av_fifo_generic_write
(
f
->
fifo
,
&
pkt
,
sizeof
(
pkt
),
NULL
);
av_fifo_generic_write
(
f
->
fifo
,
&
pkt
,
sizeof
(
pkt
),
NULL
);
pthread_mutex_unlock
(
&
f
->
fifo_lock
);
pthread_mutex_unlock
(
&
f
->
fifo_lock
);
...
...
avplay.c
View file @
a5d42043
...
@@ -320,10 +320,6 @@ static int packet_queue_put(PacketQueue *q, AVPacket *pkt)
...
@@ -320,10 +320,6 @@ static int packet_queue_put(PacketQueue *q, AVPacket *pkt)
{
{
AVPacketList
*
pkt1
;
AVPacketList
*
pkt1
;
/* duplicate the packet */
if
(
pkt
!=
&
flush_pkt
&&
av_dup_packet
(
pkt
)
<
0
)
return
-
1
;
pkt1
=
av_malloc
(
sizeof
(
AVPacketList
));
pkt1
=
av_malloc
(
sizeof
(
AVPacketList
));
if
(
!
pkt1
)
if
(
!
pkt1
)
return
-
1
;
return
-
1
;
...
...
libavformat/utils.c
View file @
a5d42043
...
@@ -413,6 +413,14 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt)
...
@@ -413,6 +413,14 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt)
continue
;
continue
;
}
}
if
(
!
pkt
->
buf
)
{
AVPacket
tmp
=
{
0
};
ret
=
av_packet_ref
(
&
tmp
,
pkt
);
if
(
ret
<
0
)
return
ret
;
*
pkt
=
tmp
;
}
if
((
s
->
flags
&
AVFMT_FLAG_DISCARD_CORRUPT
)
&&
if
((
s
->
flags
&
AVFMT_FLAG_DISCARD_CORRUPT
)
&&
(
pkt
->
flags
&
AV_PKT_FLAG_CORRUPT
))
{
(
pkt
->
flags
&
AV_PKT_FLAG_CORRUPT
))
{
av_log
(
s
,
AV_LOG_WARNING
,
av_log
(
s
,
AV_LOG_WARNING
,
...
...
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