#include "libavutil/avstring.h"
#include "libavutil/colorspace.h"
#include "libavutil/pixdesc.h"
-#include "libavcore/imgutils.h"
-#include "libavcore/parseutils.h"
-#include "libavcore/samplefmt.h"
+#include "libavutil/imgutils.h"
+#include "libavutil/parseutils.h"
+#include "libavutil/samplefmt.h"
#include "libavformat/avformat.h"
#include "libavdevice/avdevice.h"
#include "libswscale/swscale.h"
char filename[1024];
int width, height, xleft, ytop;
- PtsCorrectionContext pts_ctx;
-
#if CONFIG_AVFILTER
AVFilterContext *out_video_filter; ///<the last filter in the video chain
#endif
if (aspect_ratio <= 0.0)
aspect_ratio = 1.0;
aspect_ratio *= (float)vp->width / (float)vp->height;
- /* if an active format is indicated, then it overrides the
- mpeg format */
-#if 0
- if (is->video_st->codec->dtg_active_format != is->dtg_active_format) {
- is->dtg_active_format = is->video_st->codec->dtg_active_format;
- printf("dtg_active_format=%d\n", is->dtg_active_format);
- }
-#endif
-#if 0
- switch(is->video_st->codec->dtg_active_format) {
- case FF_DTG_AFD_SAME:
- default:
- /* nothing to do */
- break;
- case FF_DTG_AFD_4_3:
- aspect_ratio = 4.0 / 3.0;
- break;
- case FF_DTG_AFD_16_9:
- aspect_ratio = 16.0 / 9.0;
- break;
- case FF_DTG_AFD_14_9:
- aspect_ratio = 14.0 / 9.0;
- break;
- case FF_DTG_AFD_4_3_SP_14_9:
- aspect_ratio = 14.0 / 9.0;
- break;
- case FF_DTG_AFD_16_9_SP_14_9:
- aspect_ratio = 14.0 / 9.0;
- break;
- case FF_DTG_AFD_SP_4_3:
- aspect_ratio = 4.0 / 3.0;
- break;
- }
-#endif
if (is->subtitle_st)
{
if (is->audio_st && is->video_st)
av_diff = get_audio_clock(is) - get_video_clock(is);
printf("%7.2f A-V:%7.3f s:%3.1f aq=%5dKB vq=%5dKB sq=%5dB f=%"PRId64"/%"PRId64" \r",
- get_master_clock(is), av_diff, FFMAX(is->skip_frames-1, 0), aqsize / 1024, vqsize / 1024, sqsize, is->pts_ctx.num_faulty_dts, is->pts_ctx.num_faulty_pts);
+ get_master_clock(is),
+ av_diff,
+ FFMAX(is->skip_frames-1, 0),
+ aqsize / 1024,
+ vqsize / 1024,
+ sqsize,
+ is->video_st ? is->video_st->codec->pts_correction_num_faulty_dts : 0,
+ is->video_st ? is->video_st->codec->pts_correction_num_faulty_pts : 0);
fflush(stdout);
last_time = cur_time;
}
is->video_current_pos = -1;
SDL_UnlockMutex(is->pictq_mutex);
- init_pts_correction(&is->pts_ctx);
is->frame_last_pts = AV_NOPTS_VALUE;
is->frame_last_delay = 0;
is->frame_timer = (double)av_gettime() / 1000000.0;
if (got_picture) {
if (decoder_reorder_pts == -1) {
- *pts = guess_correct_pts(&is->pts_ctx, frame->pkt_pts, frame->pkt_dts);
+ *pts = frame->best_effort_timestamp;
} else if (decoder_reorder_pts) {
*pts = frame->pkt_pts;
} else {
codec->get_buffer = input_get_buffer;
codec->release_buffer = input_release_buffer;
codec->reget_buffer = input_reget_buffer;
+ codec->thread_safe_callbacks = 1;
}
priv->frame = avcodec_alloc_frame();
avctx->skip_loop_filter= skip_loop_filter;
avctx->error_recognition= error_recognition;
avctx->error_concealment= error_concealment;
- avcodec_thread_init(avctx, thread_count);
+ avctx->thread_count= thread_count;
set_context_opts(avctx, avcodec_opts[avctx->codec_type], 0, codec);
st_index[AVMEDIA_TYPE_VIDEO]),
NULL, 0);
if (show_status) {
- dump_format(ic, 0, is->filename, 0);
+ av_dump_format(ic, 0, is->filename, 0);
}
/* open the streams */
goto fail;
}
}
+ eof=0;
continue;
}
ret = av_read_frame(ic, pkt);
if (ret < 0) {
if (ret == AVERROR_EOF || url_feof(ic->pb))
eof=1;
- if (url_ferror(ic->pb))
+ if (ic->pb && ic->pb->error)
break;
SDL_Delay(100); /* wait for user event */
continue;
}else if(cur_stream->audio_stream >= 0 && cur_stream->audio_pkt.pos>=0){
pos= cur_stream->audio_pkt.pos;
}else
- pos = url_ftell(cur_stream->ic->pb);
+ pos = avio_tell(cur_stream->ic->pb);
if (cur_stream->ic->bit_rate)
incr *= cur_stream->ic->bit_rate / 8.0;
else
}
if (cur_stream) {
if(seek_by_bytes || cur_stream->ic->duration<=0){
- uint64_t size= url_fsize(cur_stream->ic->pb);
+ uint64_t size= avio_size(cur_stream->ic->pb);
stream_seek(cur_stream, size*x/cur_stream->width, 0, 1);
}else{
int64_t ts;
#endif
{ "rdftspeed", OPT_INT | HAS_ARG| OPT_AUDIO | OPT_EXPERT, {(void*)&rdftspeed}, "rdft speed", "msecs" },
{ "default", OPT_FUNC2 | HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {(void*)opt_default}, "generic catch all option", "" },
+ { "i", OPT_DUMMY, {NULL}, "ffmpeg compatibility dummy option", ""},
{ NULL, },
};