changeset 34528:cd1c0283e645

Reuse init_avcodec function.
author reimar
date Sat, 28 Jan 2012 11:06:35 +0000
parents 11c8d827b55e
children 65f42b3c0efc
files sub/av_sub.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/sub/av_sub.c	Sat Jan 28 10:53:17 2012 +0000
+++ b/sub/av_sub.c	Sat Jan 28 11:06:35 2012 +0000
@@ -21,6 +21,7 @@
 #include "mp_msg.h"
 #include "sub.h"
 #include "spudec.h"
+#include "av_helpers.h"
 #include "av_sub.h"
 
 void reset_avsub(struct sh_sub *sh)
@@ -63,8 +64,7 @@
         pkt.convergence_duration = (*endpts - *pts) * 1000;
     if (!ctx) {
         AVCodec *sub_codec;
-        avcodec_init();
-        avcodec_register_all();
+        init_avcodec();
         ctx = avcodec_alloc_context();
         sub_codec = avcodec_find_decoder(cid);
         if (!ctx || !sub_codec || avcodec_open(ctx, sub_codec) < 0) {