edge = codec->flags & CODEC_FLAG_EMU_EDGE ? 0 : avcodec_get_edge_width();
w += edge << 1;
h += edge << 1;
-
+ if (codec->pix_fmt != ctx->outputs[0]->format) {
+ av_log(codec, AV_LOG_ERROR, "Pixel format mismatches %d %d\n", codec->pix_fmt, ctx->outputs[0]->format);
+ return -1;
+ }
if(!(ref = avfilter_get_video_buffer(ctx->outputs[0], perms, w, h)))
return -1;
pkt_temp->data = pkt->data;
pkt_temp->size = pkt->size;
+ pkt_temp->flags = pkt->flags;
+ pkt_temp->side_data = pkt->side_data;
+ pkt_temp->side_data_elems = pkt->side_data_elems;
/* if update the audio clock with the pts */
if (pkt->pts != AV_NOPTS_VALUE) {
return -1;
avctx = ic->streams[stream_index]->codec;
- opts = filter_codec_opts(codec_opts, avctx->codec_id, ic, ic->streams[stream_index]);
-
codec = avcodec_find_decoder(avctx->codec_id);
+ opts = filter_codec_opts(codec_opts, codec, ic, ic->streams[stream_index]);
+
switch(avctx->codec_type){
case AVMEDIA_TYPE_AUDIO : if(audio_codec_name ) codec= avcodec_find_decoder_by_name( audio_codec_name); break;
case AVMEDIA_TYPE_SUBTITLE: if(subtitle_codec_name) codec= avcodec_find_decoder_by_name(subtitle_codec_name); break;
variable instead of a thread local variable */
static VideoState *global_video_state;
-static int decode_interrupt_cb(void)
+static int decode_interrupt_cb(void *ctx)
{
return (global_video_state && global_video_state->abort_request);
}
is->subtitle_stream = -1;
global_video_state = is;
- avio_set_interrupt_cb(decode_interrupt_cb);
+ ic = avformat_alloc_context();
+ ic->interrupt_callback.callback = decode_interrupt_cb;
err = avformat_open_input(&ic, is->filename, is->iformat, &format_opts);
if (err < 0) {
print_error(is->filename, err);