Index: gpac/modules/ffmpeg_in/ffmpeg_decode.c =================================================================== --- gpac.orig/modules/ffmpeg_in/ffmpeg_decode.c +++ gpac/modules/ffmpeg_in/ffmpeg_decode.c @@ -111,7 +111,7 @@ static GF_Err FFDEC_AttachStream(GF_Base bs = gf_bs_new(esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength, GF_BITSTREAM_READ); codec_id = gf_bs_read_u32(bs); if (ffd->st==GF_STREAM_AUDIO) { - ffd->ctx->codec_type = CODEC_TYPE_AUDIO; + ffd->ctx->codec_type = AVMEDIA_TYPE_AUDIO; ffd->ctx->sample_rate = gf_bs_read_u32(bs); ffd->ctx->channels = gf_bs_read_u16(bs); ffd->ctx->frame_size = gf_bs_read_u16(bs); @@ -121,7 +121,7 @@ static GF_Err FFDEC_AttachStream(GF_Base /*ffmpeg specific*/ ffd->ctx->block_align = gf_bs_read_u16(bs); } else if (ffd->st==GF_STREAM_VISUAL) { - ffd->ctx->codec_type = CODEC_TYPE_VIDEO; + ffd->ctx->codec_type = AVMEDIA_TYPE_VIDEO; ffd->ctx->width = gf_bs_read_u16(bs); ffd->ctx->height = gf_bs_read_u16(bs); } @@ -138,7 +138,7 @@ static GF_Err FFDEC_AttachStream(GF_Base bs = gf_bs_new(esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength, GF_BITSTREAM_READ); codec_id = gf_bs_read_u32(bs); if (ffd->st==GF_STREAM_AUDIO) { - ffd->ctx->codec_type = CODEC_TYPE_AUDIO; + ffd->ctx->codec_type = AVMEDIA_TYPE_AUDIO; ffd->ctx->sample_rate = gf_bs_read_u32(bs); ffd->ctx->channels = gf_bs_read_u16(bs); ffd->ctx->frame_size = gf_bs_read_u16(bs); @@ -151,7 +151,7 @@ static GF_Err FFDEC_AttachStream(GF_Base ffd->ctx->frame_size = 160; } } else if (ffd->st==GF_STREAM_VISUAL) { - ffd->ctx->codec_type = CODEC_TYPE_VIDEO; + ffd->ctx->codec_type = AVMEDIA_TYPE_VIDEO; ffd->ctx->width = gf_bs_read_u16(bs); ffd->ctx->height = gf_bs_read_u16(bs); } @@ -163,7 +163,7 @@ static GF_Err FFDEC_AttachStream(GF_Base else { u32 codec_id = 0; if (ffd->st==GF_STREAM_VISUAL) { - ffd->ctx->codec_type = CODEC_TYPE_VIDEO; + ffd->ctx->codec_type = AVMEDIA_TYPE_VIDEO; switch (ffd->oti) { case 0x20: codec_id = CODEC_ID_MPEG4; @@ -190,7 +190,7 @@ static GF_Err FFDEC_AttachStream(GF_Base break; } } else if (ffd->st==GF_STREAM_AUDIO) { - ffd->ctx->codec_type = CODEC_TYPE_AUDIO; + ffd->ctx->codec_type = AVMEDIA_TYPE_AUDIO; switch (ffd->oti) { case 0x69: case 0x6B: @@ -412,20 +412,20 @@ static GF_Err FFDEC_ProcessData(GF_Media /*WARNING: this breaks H264 (and maybe others) decoding, disabled for now*/ #if 1 - if (!ffd->ctx->hurry_up) { + if (ffd->ctx->skip_frame=AVDISCARD_DEFAULT) { switch (mmlevel) { case GF_CODEC_LEVEL_SEEK: case GF_CODEC_LEVEL_DROP: /*skip as much as possible*/ - ffd->ctx->hurry_up = 5; + ffd->ctx->skip_frame = AVDISCARD_ALL; break; case GF_CODEC_LEVEL_VERY_LATE: case GF_CODEC_LEVEL_LATE: /*skip B-frames*/ - ffd->ctx->hurry_up = 1; + ffd->ctx->skip_frame = AVDISCARD_BIDIR; break; default: - ffd->ctx->hurry_up = 0; + ffd->ctx->skip_frame = AVDISCARD_DEFAULT; break; } } @@ -452,7 +452,7 @@ redecode: if (len<0) { ffd->frame_start = 0; return GF_NON_COMPLIANT_BITSTREAM; } if (gotpic<0) { ffd->frame_start = 0; return GF_OK; } - ffd->ctx->hurry_up = 0; + ffd->ctx->skip_frame = AVDISCARD_DEFAULT; if (ffd->ctx->frame_size < gotpic) ffd->ctx->frame_size = gotpic; @@ -553,7 +553,7 @@ redecode: } } } - ffd->ctx->hurry_up = 0; + ffd->ctx->skip_frame = AVDISCARD_DEFAULT; /*recompute outsize in case on-the-fly change*/ if ((w != ffd->ctx->width) || (h != ffd->ctx->height)) { outsize = ffd->ctx->width * ffd->ctx->height * 3; Index: gpac/modules/ffmpeg_in/ffmpeg_demux.c =================================================================== --- gpac.orig/modules/ffmpeg_in/ffmpeg_demux.c +++ gpac/modules/ffmpeg_in/ffmpeg_demux.c @@ -233,10 +233,10 @@ static Bool FFD_CanHandleURL(GF_InputSer for(i = 0; i < ctx->nb_streams; i++) { AVCodecContext *enc = ctx->streams[i]->codec; switch(enc->codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: if (!has_audio) has_audio = 1; break; - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: if (!has_video) has_video= 1; break; default: @@ -552,13 +552,13 @@ static GF_Err FFD_ConnectService(GF_Inpu for (i = 0; i < ffd->ctx->nb_streams; i++) { AVCodecContext *enc = ffd->ctx->streams[i]->codec; switch(enc->codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: if ((ffd->audio_st<0) && (ffd->service_type!=1)) { ffd->audio_st = i; ffd->audio_tscale = ffd->ctx->streams[i]->time_base; } break; - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: if ((ffd->video_st<0) && (ffd->service_type!=2)) { ffd->video_st = i; ffd->video_tscale = ffd->ctx->streams[i]->time_base;