summaryrefslogtreecommitdiffstats
path: root/libvo/video_out.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@symbol.nonexistent.invalid>2008-04-20 06:04:10 +0300
committerUoti Urpala <uau@symbol.nonexistent.invalid>2008-04-23 13:41:06 +0300
commit1ebfddd812230d641d934d312646638dd7091ba9 (patch)
tree6622aed369231b19011cafe99a312a8ff3bb126b /libvo/video_out.c
parent95a909b4fd758c16ed1fb1449fa7294d9c44ab91 (diff)
downloadmpv-1ebfddd812230d641d934d312646638dd7091ba9.tar.bz2
mpv-1ebfddd812230d641d934d312646638dd7091ba9.tar.xz
Allocate vo struct with talloc
Also allocate the private vo_xv struct as a child and remove explicit free() for it.
Diffstat (limited to 'libvo/video_out.c')
-rw-r--r--libvo/video_out.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libvo/video_out.c b/libvo/video_out.c
index bb1e29d0c9..abbaaae7ef 100644
--- a/libvo/video_out.c
+++ b/libvo/video_out.c
@@ -11,6 +11,7 @@
#include "config.h"
#include "options.h"
+#include "talloc.h"
#include "video_out.h"
#include "aspect.h"
#include "geometry.h"
@@ -282,7 +283,7 @@ void vo_check_events(struct vo *vo)
void vo_destroy(struct vo *vo)
{
vo->driver->uninit(vo);
- free(vo);
+ talloc_free(vo);
}
void list_video_out(void)
@@ -301,7 +302,7 @@ struct vo *init_best_video_out(struct MPOpts *opts)
{
char **vo_list = opts->video_driver_list;
int i;
- struct vo *vo = malloc(sizeof *vo);
+ struct vo *vo = talloc_ptrtype(NULL, vo);
// first try the preferred drivers, with their optional subdevice param:
if (vo_list && vo_list[0])
while (vo_list[0][0]) {