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
a447b75d
Commit
a447b75d
authored
Sep 23, 2017
by
James Almer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat: replace all uses of av_copy_packet()
Signed-off-by:
James Almer
<
jamrial@gmail.com
>
parent
ecb9741b
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
15 additions
and
13 deletions
+15
-13
aiffenc.c
libavformat/aiffenc.c
+2
-1
apngenc.c
libavformat/apngenc.c
+2
-2
gif.c
libavformat/gif.c
+2
-2
img2enc.c
libavformat/img2enc.c
+1
-1
movenc.c
libavformat/movenc.c
+4
-3
mp3enc.c
libavformat/mp3enc.c
+1
-1
subtitles.c
libavformat/subtitles.c
+1
-1
webpenc.c
libavformat/webpenc.c
+1
-1
wtvenc.c
libavformat/wtvenc.c
+1
-1
No files found.
libavformat/aiffenc.c
View file @
a447b75d
...
...
@@ -233,7 +233,8 @@ static int aiff_write_packet(AVFormatContext *s, AVPacket *pkt)
if
(
!
pict_list
)
return
AVERROR
(
ENOMEM
);
if
((
ret
=
av_copy_packet
(
&
pict_list
->
pkt
,
pkt
))
<
0
)
{
ret
=
av_packet_ref
(
&
pict_list
->
pkt
,
pkt
);
if
(
ret
<
0
)
{
av_freep
(
&
pict_list
);
return
ret
;
}
...
...
libavformat/apngenc.c
View file @
a447b75d
...
...
@@ -218,7 +218,7 @@ static int flush_packet(AVFormatContext *format_context, AVPacket *packet)
av_packet_unref
(
apng
->
prev_packet
);
if
(
packet
)
av_
copy_packet
(
apng
->
prev_packet
,
packet
);
av_
packet_ref
(
apng
->
prev_packet
,
packet
);
return
0
;
}
...
...
@@ -232,7 +232,7 @@ static int apng_write_packet(AVFormatContext *format_context, AVPacket *packet)
if
(
!
apng
->
prev_packet
)
return
AVERROR
(
ENOMEM
);
av_
copy_packet
(
apng
->
prev_packet
,
packet
);
av_
packet_ref
(
apng
->
prev_packet
,
packet
);
}
else
{
ret
=
flush_packet
(
format_context
,
packet
);
if
(
ret
<
0
)
...
...
libavformat/gif.c
View file @
a447b75d
...
...
@@ -175,7 +175,7 @@ static int flush_packet(AVFormatContext *s, AVPacket *new)
av_packet_unref
(
gif
->
prev_pkt
);
if
(
new
)
av_
copy_packet
(
gif
->
prev_pkt
,
new
);
av_
packet_ref
(
gif
->
prev_pkt
,
new
);
return
0
;
}
...
...
@@ -206,7 +206,7 @@ static int gif_write_packet(AVFormatContext *s, AVPacket *pkt)
gif_image_write_header
(
s
->
pb
,
video_st
,
gif
->
loop
,
palette
);
}
return
av_
copy_packet
(
gif
->
prev_pkt
,
pkt
);
return
av_
packet_ref
(
gif
->
prev_pkt
,
pkt
);
}
return
flush_packet
(
s
,
pkt
);
}
...
...
libavformat/img2enc.c
View file @
a447b75d
...
...
@@ -161,7 +161,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
st
->
id
=
pkt
->
stream_index
;
fmt
->
pb
=
pb
[
0
];
if
((
ret
=
av_
copy_packet
(
&
pkt2
,
pkt
))
<
0
||
if
((
ret
=
av_
packet_ref
(
&
pkt2
,
pkt
))
<
0
||
(
ret
=
av_dup_packet
(
&
pkt2
))
<
0
||
(
ret
=
avcodec_parameters_copy
(
st
->
codecpar
,
s
->
streams
[
0
]
->
codecpar
))
<
0
||
(
ret
=
avformat_write_header
(
fmt
,
NULL
))
<
0
||
...
...
libavformat/movenc.c
View file @
a447b75d
...
...
@@ -437,8 +437,8 @@ concatenate:
return
AVERROR_INVALIDDATA
;
if
(
!
info
->
num_blocks
)
{
int
ret
;
if
(
(
ret
=
av_copy_packet
(
&
info
->
pkt
,
pkt
))
<
0
)
int
ret
=
av_packet_ref
(
&
info
->
pkt
,
pkt
)
;
if
(
ret
<
0
)
return
ret
;
info
->
num_blocks
=
num_blocks
;
return
0
;
...
...
@@ -454,7 +454,8 @@ concatenate:
if
(
info
->
num_blocks
!=
6
)
return
0
;
av_packet_unref
(
pkt
);
if
((
ret
=
av_copy_packet
(
pkt
,
&
info
->
pkt
))
<
0
)
ret
=
av_packet_ref
(
pkt
,
&
info
->
pkt
);
if
(
ret
<
0
)
return
ret
;
av_packet_unref
(
&
info
->
pkt
);
info
->
num_blocks
=
0
;
...
...
libavformat/mp3enc.c
View file @
a447b75d
...
...
@@ -523,7 +523,7 @@ static int mp3_write_packet(AVFormatContext *s, AVPacket *pkt)
return
mp3_write_audio_packet
(
s
,
pkt
);
}
ret
=
av_
copy_packet
(
&
pktl
->
pkt
,
pkt
);
ret
=
av_
packet_ref
(
&
pktl
->
pkt
,
pkt
);
if
(
ret
<
0
)
{
av_freep
(
&
pktl
);
return
ret
;
...
...
libavformat/subtitles.c
View file @
a447b75d
...
...
@@ -211,7 +211,7 @@ int ff_subtitles_queue_read_packet(FFDemuxSubtitlesQueue *q, AVPacket *pkt)
if
(
q
->
current_sub_idx
==
q
->
nb_subs
)
return
AVERROR_EOF
;
if
(
av_
copy_packet
(
pkt
,
sub
)
<
0
)
{
if
(
av_
packet_ref
(
pkt
,
sub
)
<
0
)
{
return
AVERROR
(
ENOMEM
);
}
...
...
libavformat/webpenc.c
View file @
a447b75d
...
...
@@ -158,7 +158,7 @@ static int webp_write_packet(AVFormatContext *s, AVPacket *pkt)
int
ret
;
if
((
ret
=
flush
(
s
,
0
,
pkt
->
pts
))
<
0
)
return
ret
;
av_
copy_packet
(
&
w
->
last_pkt
,
pkt
);
av_
packet_ref
(
&
w
->
last_pkt
,
pkt
);
}
++
w
->
frame_count
;
...
...
libavformat/wtvenc.c
View file @
a447b75d
...
...
@@ -464,7 +464,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
AVStream
*
st
=
s
->
streams
[
pkt
->
stream_index
];
if
(
st
->
codecpar
->
codec_id
==
AV_CODEC_ID_MJPEG
&&
!
wctx
->
thumbnail
.
size
)
{
av_
copy_packet
(
&
wctx
->
thumbnail
,
pkt
);
av_
packet_ref
(
&
wctx
->
thumbnail
,
pkt
);
return
0
;
}
else
if
(
st
->
codecpar
->
codec_id
==
AV_CODEC_ID_H264
)
{
int
ret
=
ff_check_h264_startcode
(
s
,
st
,
pkt
);
...
...
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