AVFrame *frame = ist->sub2video.frame;
av_frame_unref(frame);
- ist->sub2video.frame->width = ist->sub2video.w;
- ist->sub2video.frame->height = ist->sub2video.h;
+ ist->sub2video.frame->width = ist->dec_ctx->width ? ist->dec_ctx->width : ist->sub2video.w;
+ ist->sub2video.frame->height = ist->dec_ctx->height ? ist->dec_ctx->height : ist->sub2video.h;
ist->sub2video.frame->format = AV_PIX_FMT_RGB32;
if ((ret = av_frame_get_buffer(frame, 32)) < 0)
return ret;
return;
}
if (r->x < 0 || r->x + r->w > w || r->y < 0 || r->y + r->h > h) {
- av_log(NULL, AV_LOG_WARNING, "sub2video: rectangle overflowing\n");
+ av_log(NULL, AV_LOG_WARNING, "sub2video: rectangle (%d %d %d %d) overflowing %d %d\n",
+ r->x, r->y, r->w, r->h, w, h
+ );
return;
}
static void sub2video_update(InputStream *ist, AVSubtitle *sub)
{
- int w = ist->sub2video.w, h = ist->sub2video.h;
AVFrame *frame = ist->sub2video.frame;
int8_t *dst;
int dst_linesize;
dst = frame->data [0];
dst_linesize = frame->linesize[0];
for (i = 0; i < num_rects; i++)
- sub2video_copy_rect(dst, dst_linesize, w, h, sub->rects[i]);
+ sub2video_copy_rect(dst, dst_linesize, frame->width, frame->height, sub->rects[i]);
sub2video_push_ref(ist, pts);
ist->sub2video.end_pts = end_pts;
}
if (ist->sub2video.end_pts < INT64_MAX)
sub2video_update(ist, NULL);
for (i = 0; i < ist->nb_filters; i++)
- av_buffersrc_add_ref(ist->filters[i]->filter, NULL, 0);
+ av_buffersrc_add_frame(ist->filters[i]->filter, NULL);
}
/* end of sub2video hack */
is_pipe = !GetConsoleMode(input_handle, &dw);
}
- if (stdin->_cnt > 0) {
- read(0, &ch, 1);
- return ch;
- }
if (is_pipe) {
/* When running under a GUI, you will end here. */
if (!PeekNamedPipe(input_handle, NULL, 0, NULL, &nchars, NULL)) {
if (ist->dec_ctx->codec_id == AV_CODEC_ID_H264) {
ist->st->codec->has_b_frames = ist->dec_ctx->has_b_frames;
} else
- av_log_ask_for_sample(
- ist->dec_ctx,
- "has_b_frames is larger in decoder than demuxer %d > %d ",
- ist->dec_ctx->has_b_frames,
- ist->st->codec->has_b_frames
- );
+ av_log(ist->dec_ctx, AV_LOG_WARNING,
+ "has_b_frames is larger in decoder than demuxer %d > %d.\n"
+ "If you want to help, upload a sample "
+ "of this file to ftp://upload.ffmpeg.org/incoming/ "
+ "and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)",
+ ist->dec_ctx->has_b_frames,
+ ist->st->codec->has_b_frames);
}
if (*got_output || ret<0)
{
int i, ret;
for (i = 0; i < ist->nb_filters; i++) {
-#if 1
- ret = av_buffersrc_add_ref(ist->filters[i]->filter, NULL, 0);
-#else
ret = av_buffersrc_add_frame(ist->filters[i]->filter, NULL);
-#endif
if (ret < 0)
return ret;
}
if(!debug) debug = 1;
while(debug & (FF_DEBUG_DCT_COEFF|FF_DEBUG_VIS_QP|FF_DEBUG_VIS_MB_TYPE)) //unsupported, would just crash
debug += debug;
- }else
- if(scanf("%d", &debug)!=1)
+ }else{
+ char buf[32];
+ int k = 0;
+ i = 0;
+ while ((k = read_key()) != '\n' && k != '\r' && i < sizeof(buf)-1)
+ if (k > 0)
+ buf[i++] = k;
+ buf[i] = 0;
+ if (k <= 0 || sscanf(buf, "%d", &debug)!=1)
fprintf(stderr,"error parsing debug value\n");
+ }
for(i=0;i<nb_input_streams;i++) {
input_streams[i]->st->codec->debug = debug;
}
av_freep(&ost->apad);
av_freep(&ost->disposition);
av_dict_free(&ost->encoder_opts);
+ av_dict_free(&ost->sws_dict);
av_dict_free(&ost->swr_opts);
av_dict_free(&ost->resample_opts);
av_dict_free(&ost->bsf_args);