X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=libhb%2Fstream.c;h=9c0349096e8820d3bad3f1309fce53290d41a8c2;hb=44946a6f8be82a70e65ca534541183a26fdb804b;hp=c98f901db28e80a9b2ad1088e6a79d63b09059bb;hpb=78249a4d71c0cf6ca581bd416d88ebde0c1ef993;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/libhb/stream.c b/libhb/stream.c index c98f901d..9c034909 100644 --- a/libhb/stream.c +++ b/libhb/stream.c @@ -89,7 +89,7 @@ typedef enum { } hb_stream_type_t; #define kMaxNumberVideoPIDS 1 -#define kMaxNumberAudioPIDS 15 +#define kMaxNumberAudioPIDS 31 #define kMaxNumberDecodeStreams (kMaxNumberVideoPIDS+kMaxNumberAudioPIDS) #define kMaxNumberPMTStreams 32 @@ -275,9 +275,12 @@ static void ts_warn_helper( hb_stream_t *stream, char *log, va_list args ) } } +static void ts_warn( hb_stream_t*, char*, ... ) HB_WPRINTF(2,3); +static void ts_err( hb_stream_t*, int, char*, ... ) HB_WPRINTF(3,4); + static void ts_warn( hb_stream_t *stream, char *log, ... ) { - va_list args; + va_list args; va_start( args, log ); ts_warn_helper( stream, log, args ); va_end( args ); @@ -285,7 +288,7 @@ static void ts_warn( hb_stream_t *stream, char *log, ... ) static void ts_err( hb_stream_t *stream, int curstream, char *log, ... ) { - va_list args; + va_list args; va_start( args, log ); ts_warn_helper( stream, log, args ); va_end( args ); @@ -470,7 +473,7 @@ static int audio_inactive( hb_stream_t *stream, int indx ) **********************************************************************/ hb_stream_t * hb_stream_open( char *path, hb_title_t *title ) { - FILE *f = fopen( path, "r" ); + FILE *f = fopen( path, "rb" ); if ( f == NULL ) { hb_log( "hb_stream_open: open %s failed", path ); @@ -751,10 +754,10 @@ static const uint8_t *next_packet( hb_stream_t *stream ) off_t pos2 = align_to_next_packet(stream); if ( pos2 == 0 ) { - hb_log( "next_packet: eof while re-establishing sync @ %lld", pos ); + hb_log( "next_packet: eof while re-establishing sync @ %"PRId64, pos ); return NULL; } - ts_warn( stream, "next_packet: sync lost @ %lld, regained after %lld bytes", + ts_warn( stream, "next_packet: sync lost @ %"PRId64", regained after %"PRId64" bytes", pos, pos2 ); } } @@ -1025,12 +1028,12 @@ static struct pts_pos hb_sample_pts(hb_stream_t *stream, uint64_t fpos) buf = hb_ts_stream_getPEStype( stream, stream->ts_video_pids[0] ); if ( buf == NULL ) { - hb_log("hb_sample_pts: couldn't find video packet near %llu", fpos); + hb_log("hb_sample_pts: couldn't find video packet near %"PRIu64, fpos); return pp; } if ( ( buf[7] >> 7 ) != 1 ) { - hb_log("hb_sample_pts: no PTS in video packet near %llu", fpos); + hb_log("hb_sample_pts: no PTS in video packet near %"PRIu64, fpos); return pp; } pp.pts = ( ( (uint64_t)buf[9] >> 1 ) & 7 << 30 ) | @@ -1217,7 +1220,7 @@ int hb_stream_seek_chapter( hb_stream_t * stream, int chapter_num ) } int64_t sum_dur = 0; - hb_chapter_t *chapter; + hb_chapter_t *chapter = NULL; int i; for ( i = 0; i < chapter_num; ++i) { @@ -1229,7 +1232,7 @@ int hb_stream_seek_chapter( hb_stream_t * stream, int chapter_num ) int64_t pos = ( ( ( sum_dur - chapter->duration ) * AV_TIME_BASE ) / 90000 ); - hb_deep_log( 2, "Seeking to chapter %d: starts %lld, ends %lld, AV pos %lld", + hb_deep_log( 2, "Seeking to chapter %d: starts %"PRId64", ends %"PRId64", AV pos %"PRId64, chapter_num, sum_dur - chapter->duration, sum_dur, pos); if ( chapter_num > 1 && pos > 0 ) @@ -1699,6 +1702,10 @@ static void decode_element_descriptors(hb_stream_t* stream, int esindx, stream->a52_info[esindx].lang_code = lang_to_code(lang_for_code2((const char *)&dp[2])); break; + case 0x6a: // DVB AC-3 descriptor + stream->ts_stream_type[esindx+1] = 0x81; + break; + default: break; } @@ -2721,7 +2728,7 @@ static hb_title_t *ffmpeg_title_scan( hb_stream_t *stream ) chapter->minutes = ( ( chapter->duration / 90000 ) % 3600 ) / 60; chapter->seconds = ( chapter->duration / 90000 ) % 60; strcpy( chapter->title, m->title ); - hb_deep_log( 2, "Added chapter %i, name='%s', dur=%llu, (%02i:%02i:%02i)", + hb_deep_log( 2, "Added chapter %i, name='%s', dur=%"PRIu64", (%02i:%02i:%02i)", chapter->index, chapter->title, chapter->duration, chapter->hours, chapter->minutes, chapter->seconds ); @@ -2898,7 +2905,7 @@ static int ffmpeg_read( hb_stream_t *stream, hb_buffer_t *buf ) { stream->chapter_end += chapter->duration; buf->new_chap = stream->chapter + 1; - hb_deep_log( 2, "ffmpeg_read starting chapter %i at %lld", + hb_deep_log( 2, "ffmpeg_read starting chapter %i at %"PRId64, buf->new_chap, buf->start); } else { // Must have run out of chapters, stop looking.