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
e1d7c883
Commit
e1d7c883
authored
Jul 11, 2010
by
Reimar Döffinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add avsubtitle_free function.
Originally committed as revision 24185 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
c426562c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
14 deletions
+36
-14
APIchanges
doc/APIchanges
+4
-0
ffplay.c
ffplay.c
+1
-12
avcodec.h
libavcodec/avcodec.h
+11
-2
utils.c
libavcodec/utils.c
+20
-0
No files found.
doc/APIchanges
View file @
e1d7c883
...
...
@@ -12,6 +12,10 @@ libavutil: 2009-03-08
API changes, most recent first:
2010-07-11 - r24185 - lavc 52.82.0 - avsubtitle_free()
Add a function for free the contents of a AVSubtitle generated by
avcodec_decode_subtitle.
2010-07-08 - r24101 - lavu 50.21.0 - pixdesc.h
Rename read/write_line() to av_read/write_image_line().
...
...
ffplay.c
View file @
e1d7c883
...
...
@@ -677,18 +677,7 @@ static void blend_subrect(AVPicture *dst, const AVSubtitleRect *rect, int imgw,
static
void
free_subpicture
(
SubPicture
*
sp
)
{
int
i
;
for
(
i
=
0
;
i
<
sp
->
sub
.
num_rects
;
i
++
)
{
av_freep
(
&
sp
->
sub
.
rects
[
i
]
->
pict
.
data
[
0
]);
av_freep
(
&
sp
->
sub
.
rects
[
i
]
->
pict
.
data
[
1
]);
av_freep
(
&
sp
->
sub
.
rects
[
i
]);
}
av_free
(
sp
->
sub
.
rects
);
memset
(
&
sp
->
sub
,
0
,
sizeof
(
AVSubtitle
));
avsubtitle_free
(
&
sp
->
sub
);
}
static
void
video_image_display
(
VideoState
*
is
)
...
...
libavcodec/avcodec.h
View file @
e1d7c883
...
...
@@ -30,7 +30,7 @@
#include "libavutil/avutil.h"
#define LIBAVCODEC_VERSION_MAJOR 52
#define LIBAVCODEC_VERSION_MINOR 8
1
#define LIBAVCODEC_VERSION_MINOR 8
2
#define LIBAVCODEC_VERSION_MICRO 0
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
...
...
@@ -3548,13 +3548,22 @@ attribute_deprecated int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtit
* due to a potentially very different allocation pattern.
*
* @param avctx the codec context
* @param[out] sub The AVSubtitle in which the decoded subtitle will be stored.
* @param[out] sub The AVSubtitle in which the decoded subtitle will be stored, must be
freed with avsubtitle_free if *got_sub_ptr is set.
* @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero.
* @param[in] avpkt The input AVPacket containing the input buffer.
*/
int
avcodec_decode_subtitle2
(
AVCodecContext
*
avctx
,
AVSubtitle
*
sub
,
int
*
got_sub_ptr
,
AVPacket
*
avpkt
);
/**
* Frees all allocated data in the given subtitle struct.
*
* @param sub AVSubtitle to free.
*/
void
avsubtitle_free
(
AVSubtitle
*
sub
);
int
avcodec_parse_frame
(
AVCodecContext
*
avctx
,
uint8_t
**
pdata
,
int
*
data_size_ptr
,
uint8_t
*
buf
,
int
buf_size
);
...
...
libavcodec/utils.c
View file @
e1d7c883
...
...
@@ -689,6 +689,26 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
return
ret
;
}
void
avsubtitle_free
(
AVSubtitle
*
sub
)
{
int
i
;
for
(
i
=
0
;
i
<
sub
->
num_rects
;
i
++
)
{
av_freep
(
sub
->
rects
[
i
]
->
pict
.
data
[
0
]);
av_freep
(
sub
->
rects
[
i
]
->
pict
.
data
[
1
]);
av_freep
(
sub
->
rects
[
i
]
->
pict
.
data
[
2
]);
av_freep
(
sub
->
rects
[
i
]
->
pict
.
data
[
3
]);
av_freep
(
sub
->
rects
[
i
]
->
text
);
av_freep
(
sub
->
rects
[
i
]
->
ass
);
av_freep
(
sub
->
rects
[
i
]);
}
av_freep
(
sub
->
rects
);
memset
(
sub
,
0
,
sizeof
(
AVSubtitle
));
}
av_cold
int
avcodec_close
(
AVCodecContext
*
avctx
)
{
/* If there is a user-supplied mutex locking routine, call it. */
...
...
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