summaryrefslogtreecommitdiffstats
path: root/libhb/hb.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2011-07-27 15:09:49 +0000
committerjstebbins <[email protected]>2011-07-27 15:09:49 +0000
commit7a47aa6da23391fa2f4f0bc46eb4f814e4590661 (patch)
treec464eed037523e1fee104e78b68c4a75e71e478d /libhb/hb.c
parente71ac4bb36c9cec69ed4cb45a48e179d662fa828 (diff)
libhb: fix or simplify several hacks involved with Libav support
For files that are demuxed by Libav, we must share the format context with the decoder iso that it can obtain the codec context for each stream. The code that did this was very convoluted and difficult to understand. It is simplified by simply passing the context in hb_title_t. Reader was closing stream files before the decoder was finished with the context. This created the need to delay the actual close and cache the context. Changed reader so it behaves more like the rest of handbrake's work objects which lets us explicitly close after the decoders are finished. Libav does some probing of the file when av_find_stream_info is called. This probing leaves the format context in a bad state for some files and causes subsequent reads or seeks to misbehave. So open 2 contexts in ffmpeg_open. One is used only for probing, and the other only for reading. decavcodec.c had 2 separate decoders for files demuxed by hb and files demuxed by Libav. They have been combined and simplified. Previously, it was not possible to decode one source audio track multiple times in order to fan it out to multiple output tracks if the file is demuxed by Libav. We were using the codec context from the format context. Since there is only one of these for each stream, we could only do one decode for each stream. Use avcodec_copy_context to make copies of the codec context and allow multiple decodes. This allows removal of a lot of special case code for Libav streams that was necessary to duplicate the output of the decoder. Patch Libav's mkv demux to fix a seek problem. This has been pushed upstreams, so the next time we update Libav, we must remove this patch. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4141 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/hb.c')
-rw-r--r--libhb/hb.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/libhb/hb.c b/libhb/hb.c
index a387dc917..d3d1d5668 100644
--- a/libhb/hb.c
+++ b/libhb/hb.c
@@ -439,10 +439,8 @@ hb_handle_t * hb_init( int verbose, int update_check )
hb_register( &hb_enctheora );
hb_register( &hb_deca52 );
hb_register( &hb_decdca );
- hb_register( &hb_decavcodec );
+ hb_register( &hb_decavcodeca );
hb_register( &hb_decavcodecv );
- hb_register( &hb_decavcodecvi );
- hb_register( &hb_decavcodecai );
hb_register( &hb_declpcm );
hb_register( &hb_encfaac );
hb_register( &hb_enclame );
@@ -453,6 +451,7 @@ hb_handle_t * hb_init( int verbose, int update_check )
hb_register( &hb_encca_haac );
#endif
hb_register( &hb_encavcodeca );
+ hb_register( &hb_reader );
return h;
}
@@ -541,10 +540,8 @@ hb_handle_t * hb_init_dl( int verbose, int update_check )
hb_register( &hb_enctheora );
hb_register( &hb_deca52 );
hb_register( &hb_decdca );
- hb_register( &hb_decavcodec );
+ hb_register( &hb_decavcodeca );
hb_register( &hb_decavcodecv );
- hb_register( &hb_decavcodecvi );
- hb_register( &hb_decavcodecai );
hb_register( &hb_declpcm );
hb_register( &hb_encfaac );
hb_register( &hb_enclame );
@@ -555,6 +552,7 @@ hb_handle_t * hb_init_dl( int verbose, int update_check )
hb_register( &hb_encca_haac );
#endif
hb_register( &hb_encavcodeca );
+ hb_register( &hb_reader );
return h;
}