summaryrefslogtreecommitdiffstats
path: root/libhb/hb.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2011-10-15 21:32:20 +0000
committerjstebbins <[email protected]>2011-10-15 21:32:20 +0000
commit0646bd60a8f672a003195e1c83ebbcb08d05aa99 (patch)
tree7a0655dddf26d2a5463f6ea59a0e6e802119e867 /libhb/hb.c
parente3cbf2a342b7093d0b0b1720d3b3c933c3a4fa69 (diff)
bump Libav from v0.7.1 to v0.7-1241-g5f3fb59
Fixes VC-1 decode issue Adds partial support for interlaced VC-1 decode Adds ProRes decoder Fixes ac3 encoder dolby flag Fixes DCA frame size setting (delete patch A04) Fixes VC-1 repeat field processing (delete patch A05) Numerous other bug fixes and enhancements git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4291 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/hb.c')
-rw-r--r--libhb/hb.c41
1 files changed, 14 insertions, 27 deletions
diff --git a/libhb/hb.c b/libhb/hb.c
index 697c68c7a..f5c93de4d 100644
--- a/libhb/hb.c
+++ b/libhb/hb.c
@@ -99,7 +99,7 @@ void hb_avcodec_init()
av_register_all();
}
-int hb_avcodec_open(AVCodecContext *avctx, AVCodec *codec, int thread_count)
+int hb_avcodec_open(AVCodecContext *avctx, AVCodec *codec, AVDictionary **av_opts, int thread_count)
{
int ret;
@@ -116,7 +116,7 @@ int hb_avcodec_open(AVCodecContext *avctx, AVCodec *codec, int thread_count)
avctx->thread_count = 1;
}
- ret = avcodec_open(avctx, codec);
+ ret = avcodec_open2(avctx, codec, av_opts);
return ret;
}
@@ -127,20 +127,6 @@ int hb_avcodec_close(AVCodecContext *avctx)
return ret;
}
-int hb_av_set_string( AVCodecContext *c, AVCodec *codec, const char *name, const char *val )
-{
- void * priv_context = NULL;
-
- if ( c && codec && codec->priv_class && c->priv_data )
- priv_context = c->priv_data;
-
- int ret = av_set_string3( c, name, val, 1, NULL );
- if ( ret == AVERROR_OPTION_NOT_FOUND && priv_context )
- ret = av_set_string3( priv_context, name, val, 1, NULL );
-
- return ret;
-}
-
static int handle_jpeg(enum PixelFormat *format)
{
switch (*format) {
@@ -166,17 +152,19 @@ hb_sws_get_context(int srcW, int srcH, enum PixelFormat srcFormat,
srcRange = handle_jpeg(&srcFormat);
dstRange = handle_jpeg(&dstFormat);
+ /* enable this when implemented in Libav
flags |= SWS_FULL_CHR_H_INT | SWS_FULL_CHR_H_INP;
+ */
- av_set_int(ctx, "srcw", srcW);
- av_set_int(ctx, "srch", srcH);
- av_set_int(ctx, "src_range", srcRange);
- av_set_int(ctx, "src_format", srcFormat);
- av_set_int(ctx, "dstw", dstW);
- av_set_int(ctx, "dsth", dstH);
- av_set_int(ctx, "dst_range", dstRange);
- av_set_int(ctx, "dst_format", dstFormat);
- av_set_int(ctx, "sws_flags", flags);
+ av_opt_set_int(ctx, "srcw", srcW, 0);
+ av_opt_set_int(ctx, "srch", srcH, 0);
+ av_opt_set_int(ctx, "src_range", srcRange, 0);
+ av_opt_set_int(ctx, "src_format", srcFormat, 0);
+ av_opt_set_int(ctx, "dstw", dstW, 0);
+ av_opt_set_int(ctx, "dsth", dstH, 0);
+ av_opt_set_int(ctx, "dst_range", dstRange, 0);
+ av_opt_set_int(ctx, "dst_format", dstFormat, 0);
+ av_opt_set_int(ctx, "sws_flags", flags, 0);
sws_setColorspaceDetails( ctx,
sws_getCoefficients( SWS_CS_DEFAULT ), // src colorspace
@@ -544,8 +532,7 @@ hb_handle_t * hb_init_dl( int verbose, int update_check )
h->pause_lock = hb_lock_init();
/* libavcodec */
- avcodec_init();
- avcodec_register_all();
+ hb_avcodec_init();
/* Start library thread */
hb_log( "hb_init: starting libhb thread" );