X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=libhb%2Fstream.c;h=24093e62a74d7bd072e99782454323683c70b007;hb=4f0019f03c2e85e8634150ff0c9a31bee6d35ce5;hp=f4f5ae3fa51756266a4eeb768e17d795ce10808c;hpb=e693b7681e7e2f8833f0c3c81803acc5b062984a;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/libhb/stream.c b/libhb/stream.c index f4f5ae3f..24093e62 100644 --- a/libhb/stream.c +++ b/libhb/stream.c @@ -2928,8 +2928,16 @@ static int ffmpeg_parse_vobsub_extradata_mp4( AVCodecContext *codec, hb_subtitle codec->extradata[j+2] << 8 | // Cb codec->extradata[j+3] << 0; // Cr } - subtitle->width = codec->width; - subtitle->height = codec->height; + if (codec->width <= 0 || codec->height <= 0) + { + subtitle->width = 720; + subtitle->height = 480; + } + else + { + subtitle->width = codec->width; + subtitle->height = codec->height; + } return 0; } @@ -2974,14 +2982,11 @@ static void add_ffmpeg_subtitle( hb_title_t *title, hb_stream_t *stream, int id subtitle->source = TX3GSUB; subtitle->config.dest = PASSTHRUSUB; break; - // TODO(davidfstr): implement SSA subtitle support - /* case CODEC_ID_SSA: subtitle->format = TEXTSUB; subtitle->source = SSASUB; subtitle->config.dest = PASSTHRUSUB; break; - */ default: hb_log( "add_ffmpeg_subtitle: unknown subtitle stream type: 0x%x", (int) codec->codec_id ); free(subtitle); @@ -3254,6 +3259,10 @@ static int ffmpeg_read( hb_stream_t *stream, hb_buffer_t *buf ) * VOB subtitles (CODEC_ID_DVD_SUBTITLE) do not have their duration stored in * either field. This is not a problem because the VOB decoder can extract this * information from the packet payload itself. + * + * SSA subtitles (CODEC_ID_SSA) do not have their duration stored in + * either field. This is not a problem because the SSA decoder can extract this + * information from the packet payload itself. */ enum CodecID ffmpeg_pkt_codec = stream->ffmpeg_ic->streams[stream->ffmpeg_pkt->stream_index]->codec->codec_id; if ( ffmpeg_pkt_codec == CODEC_ID_TEXT ) {