OSDN Git Service
(root)
/
handbrake-jp
/
handbrake-jp-git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
This patch adds mingw32 cross-compilation support to HandBrake trunk to
[handbrake-jp/handbrake-jp-git.git]
/
libhb
/
decavcodec.c
diff --git
a/libhb/decavcodec.c
b/libhb/decavcodec.c
index
2870991
..
8b09afc
100644
(file)
--- a/
libhb/decavcodec.c
+++ b/
libhb/decavcodec.c
@@
-61,9
+61,7
@@
#include "hb.h"
#include "hbffmpeg.h"
#include "hb.h"
#include "hbffmpeg.h"
-
-//#include "libavcodec/audioconvert.h"
-#include "../contrib/ffmpeg/libavcodec/audioconvert.h"
+#include "libavcodec/audioconvert.h"
static int decavcodecInit( hb_work_object_t *, hb_job_t * );
static int decavcodecWork( hb_work_object_t *, hb_buffer_t **, hb_buffer_t ** );
static int decavcodecInit( hb_work_object_t *, hb_job_t * );
static int decavcodecWork( hb_work_object_t *, hb_buffer_t **, hb_buffer_t ** );
@@
-403,7
+401,7
@@
static int decavcodecBSInfo( hb_work_object_t *w, const hb_buffer_t *buf,
AVCodecParserContext *parser = av_parser_init( codec->id );
AVCodecContext *context = avcodec_alloc_context();
hb_avcodec_open( context, codec );
AVCodecParserContext *parser = av_parser_init( codec->id );
AVCodecContext *context = avcodec_alloc_context();
hb_avcodec_open( context, codec );
-#if
def SYS_CYGWIN
+#if
defined( SYS_CYGWIN )
uint8_t *buffer = memalign(16, AVCODEC_MAX_AUDIO_FRAME_SIZE);
#else
uint8_t *buffer = malloc( AVCODEC_MAX_AUDIO_FRAME_SIZE );
uint8_t *buffer = memalign(16, AVCODEC_MAX_AUDIO_FRAME_SIZE);
#else
uint8_t *buffer = malloc( AVCODEC_MAX_AUDIO_FRAME_SIZE );
@@
-550,13
+548,22
@@
static void flushDelayQueue( hb_work_private_t *pv )
static int decodeFrame( hb_work_private_t *pv, uint8_t *data, int size )
{
static int decodeFrame( hb_work_private_t *pv, uint8_t *data, int size )
{
- int got_picture;
+ int got_picture
, oldlevel = 0
;
AVFrame frame;
AVFrame frame;
+ if ( global_verbosity_level <= 1 )
+ {
+ oldlevel = av_log_get_level();
+ av_log_set_level( AV_LOG_QUIET );
+ }
if ( avcodec_decode_video( pv->context, &frame, &got_picture, data, size ) < 0 )
{
++pv->decode_errors;
}
if ( avcodec_decode_video( pv->context, &frame, &got_picture, data, size ) < 0 )
{
++pv->decode_errors;
}
+ if ( global_verbosity_level <= 1 )
+ {
+ av_log_set_level( oldlevel );
+ }
if( got_picture )
{
// ffmpeg makes it hard to attach a pts to a frame. if the MPEG ES
if( got_picture )
{
// ffmpeg makes it hard to attach a pts to a frame. if the MPEG ES
@@
-888,6
+895,12
@@
static int decavcodecvInfo( hb_work_object_t *w, hb_work_info_t *info )
info->rate = 27000000;
info->rate_base = (int64_t)context->time_base.num * 27000000LL /
context->time_base.den;
info->rate = 27000000;
info->rate_base = (int64_t)context->time_base.num * 27000000LL /
context->time_base.den;
+ if ( context->ticks_per_frame > 1 )
+ {
+ // for ffmpeg 0.5 & later, the H.264 & MPEG-2 time base is
+ // field rate rather than frame rate so convert back to frames.
+ info->rate_base *= context->ticks_per_frame;
+ }
/* Sometimes there's no pixel aspect set in the source. In that case,
assume a 1:1 PAR. Otherwise, preserve the source PAR. */
/* Sometimes there's no pixel aspect set in the source. In that case,
assume a 1:1 PAR. Otherwise, preserve the source PAR. */
@@
-1119,7
+1132,7
@@
static void decodeAudio( hb_work_private_t *pv, uint8_t *data, int size )
// complicated, machine dependent alignment here we use the
// fact that malloc returns an aligned pointer on most architectures.
// complicated, machine dependent alignment here we use the
// fact that malloc returns an aligned pointer on most architectures.
- #if
def SYS_CYGWIN
+ #if
defined( SYS_CYGWIN )
// Cygwin's malloc doesn't appear to return 16-byte aligned memory so use memalign instead.
pv->buffer = memalign(16, AVCODEC_MAX_AUDIO_FRAME_SIZE);
#else
// Cygwin's malloc doesn't appear to return 16-byte aligned memory so use memalign instead.
pv->buffer = memalign(16, AVCODEC_MAX_AUDIO_FRAME_SIZE);
#else