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
36773283
Commit
36773283
authored
Jun 05, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf,lavc: free avoptions in a generic way.
It's simpler and less error-prone. Fixes some memleaks along the way.
parent
b39b0623
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
9 additions
and
21 deletions
+9
-21
utils.c
libavcodec/utils.c
+3
-0
bktr.c
libavdevice/bktr.c
+0
-2
fbdev.c
libavdevice/fbdev.c
+0
-1
libdc1394.c
libavdevice/libdc1394.c
+0
-3
v4l2.c
libavdevice/v4l2.c
+0
-4
vfwcap.c
libavdevice/vfwcap.c
+0
-3
x11grab.c
libavdevice/x11grab.c
+0
-2
rawdec.c
libavformat/rawdec.c
+0
-4
tty.c
libavformat/tty.c
+0
-1
utils.c
libavformat/utils.c
+6
-1
No files found.
libavcodec/utils.c
View file @
36773283
...
...
@@ -783,6 +783,9 @@ av_cold int avcodec_close(AVCodecContext *avctx)
avctx
->
codec
->
close
(
avctx
);
avcodec_default_free_buffers
(
avctx
);
avctx
->
coded_frame
=
NULL
;
if
(
avctx
->
codec
->
priv_class
)
av_opt_free
(
avctx
->
priv_data
);
av_opt_free
(
avctx
);
av_freep
(
&
avctx
->
priv_data
);
if
(
avctx
->
codec
&&
avctx
->
codec
->
encode
)
av_freep
(
&
avctx
->
extradata
);
...
...
libavdevice/bktr.c
View file @
36773283
...
...
@@ -320,8 +320,6 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
last_frame_time
=
0
;
out:
av_freep
(
&
s
->
video_size
);
av_freep
(
&
s
->
framerate
);
return
ret
;
}
...
...
libavdevice/fbdev.c
View file @
36773283
...
...
@@ -103,7 +103,6 @@ av_cold static int fbdev_read_header(AVFormatContext *avctx,
int
ret
,
flags
=
O_RDONLY
;
ret
=
av_parse_video_rate
(
&
fbdev
->
fps
,
fbdev
->
framerate
);
av_freep
(
&
fbdev
->
framerate
);
if
(
ret
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Couldn't parse framerate.
\n
"
);
return
ret
;
...
...
libavdevice/libdc1394.c
View file @
36773283
...
...
@@ -195,9 +195,6 @@ static inline int dc1394_read_common(AVFormatContext *c, AVFormatParameters *ap,
*
select_fps
=
fps
;
*
select_fmt
=
fmt
;
out:
av_freep
(
&
dc1394
->
video_size
);
av_freep
(
&
dc1394
->
pixel_format
);
av_freep
(
&
dc1394
->
framerate
);
return
ret
;
}
...
...
libavdevice/v4l2.c
View file @
36773283
...
...
@@ -684,10 +684,6 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap)
st
->
codec
->
bit_rate
=
s
->
frame_size
*
1
/
av_q2d
(
st
->
codec
->
time_base
)
*
8
;
out:
av_freep
(
&
s
->
video_size
);
av_freep
(
&
s
->
pixel_format
);
av_freep
(
&
s
->
standard
);
av_freep
(
&
s
->
framerate
);
return
res
;
}
...
...
libavdevice/vfwcap.c
View file @
36773283
...
...
@@ -234,9 +234,6 @@ static int vfw_read_close(AVFormatContext *s)
pktl
=
next
;
}
av_freep
(
&
ctx
->
video_size
);
av_freep
(
&
ctx
->
framerate
);
return
0
;
}
...
...
libavdevice/x11grab.c
View file @
36773283
...
...
@@ -258,8 +258,6 @@ x11grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
st
->
codec
->
bit_rate
=
x11grab
->
frame_size
*
1
/
av_q2d
(
x11grab
->
time_base
)
*
8
;
out:
av_freep
(
&
x11grab
->
video_size
);
av_freep
(
&
x11grab
->
framerate
);
return
ret
;
}
...
...
libavformat/rawdec.c
View file @
36773283
...
...
@@ -102,9 +102,6 @@ int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap)
st
->
codec
->
height
=
height
;
st
->
codec
->
pix_fmt
=
pix_fmt
;
fail:
av_freep
(
&
s1
->
video_size
);
av_freep
(
&
s1
->
pixel_format
);
av_freep
(
&
s1
->
framerate
);
return
ret
;
}
default:
...
...
@@ -182,7 +179,6 @@ int ff_raw_video_read_header(AVFormatContext *s,
av_set_pts_info
(
st
,
64
,
1
,
1200000
);
fail:
av_freep
(
&
s1
->
framerate
);
return
ret
;
}
...
...
libavformat/tty.c
View file @
36773283
...
...
@@ -121,7 +121,6 @@ static int read_header(AVFormatContext *avctx,
}
fail:
av_freep
(
&
s
->
video_size
);
return
ret
;
}
...
...
libavformat/utils.c
View file @
36773283
...
...
@@ -2549,6 +2549,10 @@ void avformat_free_context(AVFormatContext *s)
int
i
;
AVStream
*
st
;
av_opt_free
(
s
);
if
(
s
->
iformat
&&
s
->
iformat
->
priv_class
)
av_opt_free
(
s
->
priv_data
);
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
{
/* free all data in a stream component */
st
=
s
->
streams
[
i
];
...
...
@@ -2578,7 +2582,6 @@ void avformat_free_context(AVFormatContext *s)
}
av_freep
(
&
s
->
chapters
);
av_metadata_free
(
&
s
->
metadata
);
av_freep
(
&
s
->
key
);
av_freep
(
&
s
->
streams
);
av_free
(
s
);
}
...
...
@@ -3094,6 +3097,8 @@ fail:
av_freep
(
&
s
->
streams
[
i
]
->
priv_data
);
av_freep
(
&
s
->
streams
[
i
]
->
index_entries
);
}
if
(
s
->
iformat
&&
s
->
iformat
->
priv_class
)
av_opt_free
(
s
->
priv_data
);
av_freep
(
&
s
->
priv_data
);
return
ret
;
}
...
...
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