1 Index: gpac/modules/ffmpeg_in/ffmpeg_decode.c
2 ===================================================================
3 --- gpac.orig/modules/ffmpeg_in/ffmpeg_decode.c
4 +++ gpac/modules/ffmpeg_in/ffmpeg_decode.c
5 @@ -111,7 +111,7 @@ static GF_Err FFDEC_AttachStream(GF_Base
6 bs = gf_bs_new(esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength, GF_BITSTREAM_READ);
7 codec_id = gf_bs_read_u32(bs);
8 if (ffd->st==GF_STREAM_AUDIO) {
9 - ffd->ctx->codec_type = CODEC_TYPE_AUDIO;
10 + ffd->ctx->codec_type = AVMEDIA_TYPE_AUDIO;
11 ffd->ctx->sample_rate = gf_bs_read_u32(bs);
12 ffd->ctx->channels = gf_bs_read_u16(bs);
13 ffd->ctx->frame_size = gf_bs_read_u16(bs);
14 @@ -121,7 +121,7 @@ static GF_Err FFDEC_AttachStream(GF_Base
16 ffd->ctx->block_align = gf_bs_read_u16(bs);
17 } else if (ffd->st==GF_STREAM_VISUAL) {
18 - ffd->ctx->codec_type = CODEC_TYPE_VIDEO;
19 + ffd->ctx->codec_type = AVMEDIA_TYPE_VIDEO;
20 ffd->ctx->width = gf_bs_read_u16(bs);
21 ffd->ctx->height = gf_bs_read_u16(bs);
23 @@ -138,7 +138,7 @@ static GF_Err FFDEC_AttachStream(GF_Base
24 bs = gf_bs_new(esd->decoderConfig->decoderSpecificInfo->data, esd->decoderConfig->decoderSpecificInfo->dataLength, GF_BITSTREAM_READ);
25 codec_id = gf_bs_read_u32(bs);
26 if (ffd->st==GF_STREAM_AUDIO) {
27 - ffd->ctx->codec_type = CODEC_TYPE_AUDIO;
28 + ffd->ctx->codec_type = AVMEDIA_TYPE_AUDIO;
29 ffd->ctx->sample_rate = gf_bs_read_u32(bs);
30 ffd->ctx->channels = gf_bs_read_u16(bs);
31 ffd->ctx->frame_size = gf_bs_read_u16(bs);
32 @@ -151,7 +151,7 @@ static GF_Err FFDEC_AttachStream(GF_Base
33 ffd->ctx->frame_size = 160;
35 } else if (ffd->st==GF_STREAM_VISUAL) {
36 - ffd->ctx->codec_type = CODEC_TYPE_VIDEO;
37 + ffd->ctx->codec_type = AVMEDIA_TYPE_VIDEO;
38 ffd->ctx->width = gf_bs_read_u16(bs);
39 ffd->ctx->height = gf_bs_read_u16(bs);
41 @@ -163,7 +163,7 @@ static GF_Err FFDEC_AttachStream(GF_Base
44 if (ffd->st==GF_STREAM_VISUAL) {
45 - ffd->ctx->codec_type = CODEC_TYPE_VIDEO;
46 + ffd->ctx->codec_type = AVMEDIA_TYPE_VIDEO;
49 codec_id = CODEC_ID_MPEG4;
50 @@ -190,7 +190,7 @@ static GF_Err FFDEC_AttachStream(GF_Base
53 } else if (ffd->st==GF_STREAM_AUDIO) {
54 - ffd->ctx->codec_type = CODEC_TYPE_AUDIO;
55 + ffd->ctx->codec_type = AVMEDIA_TYPE_AUDIO;
59 @@ -412,20 +412,20 @@ static GF_Err FFDEC_ProcessData(GF_Media
61 /*WARNING: this breaks H264 (and maybe others) decoding, disabled for now*/
63 - if (!ffd->ctx->hurry_up) {
64 + if (ffd->ctx->skip_frame=AVDISCARD_DEFAULT) {
66 case GF_CODEC_LEVEL_SEEK:
67 case GF_CODEC_LEVEL_DROP:
68 /*skip as much as possible*/
69 - ffd->ctx->hurry_up = 5;
70 + ffd->ctx->skip_frame = AVDISCARD_ALL;
72 case GF_CODEC_LEVEL_VERY_LATE:
73 case GF_CODEC_LEVEL_LATE:
75 - ffd->ctx->hurry_up = 1;
76 + ffd->ctx->skip_frame = AVDISCARD_BIDIR;
79 - ffd->ctx->hurry_up = 0;
80 + ffd->ctx->skip_frame = AVDISCARD_DEFAULT;
84 @@ -452,7 +452,7 @@ redecode:
85 if (len<0) { ffd->frame_start = 0; return GF_NON_COMPLIANT_BITSTREAM; }
86 if (gotpic<0) { ffd->frame_start = 0; return GF_OK; }
88 - ffd->ctx->hurry_up = 0;
89 + ffd->ctx->skip_frame = AVDISCARD_DEFAULT;
91 if (ffd->ctx->frame_size < gotpic) ffd->ctx->frame_size = gotpic;
93 @@ -553,7 +553,7 @@ redecode:
97 - ffd->ctx->hurry_up = 0;
98 + ffd->ctx->skip_frame = AVDISCARD_DEFAULT;
99 /*recompute outsize in case on-the-fly change*/
100 if ((w != ffd->ctx->width) || (h != ffd->ctx->height)) {
101 outsize = ffd->ctx->width * ffd->ctx->height * 3;
102 Index: gpac/modules/ffmpeg_in/ffmpeg_demux.c
103 ===================================================================
104 --- gpac.orig/modules/ffmpeg_in/ffmpeg_demux.c
105 +++ gpac/modules/ffmpeg_in/ffmpeg_demux.c
106 @@ -233,10 +233,10 @@ static Bool FFD_CanHandleURL(GF_InputSer
107 for(i = 0; i < ctx->nb_streams; i++) {
108 AVCodecContext *enc = ctx->streams[i]->codec;
109 switch(enc->codec_type) {
110 - case CODEC_TYPE_AUDIO:
111 + case AVMEDIA_TYPE_AUDIO:
112 if (!has_audio) has_audio = 1;
114 - case CODEC_TYPE_VIDEO:
115 + case AVMEDIA_TYPE_VIDEO:
116 if (!has_video) has_video= 1;
119 @@ -552,13 +552,13 @@ static GF_Err FFD_ConnectService(GF_Inpu
120 for (i = 0; i < ffd->ctx->nb_streams; i++) {
121 AVCodecContext *enc = ffd->ctx->streams[i]->codec;
122 switch(enc->codec_type) {
123 - case CODEC_TYPE_AUDIO:
124 + case AVMEDIA_TYPE_AUDIO:
125 if ((ffd->audio_st<0) && (ffd->service_type!=1)) {
127 ffd->audio_tscale = ffd->ctx->streams[i]->time_base;
130 - case CODEC_TYPE_VIDEO:
131 + case AVMEDIA_TYPE_VIDEO:
132 if ((ffd->video_st<0) && (ffd->service_type!=2)) {
134 ffd->video_tscale = ffd->ctx->streams[i]->time_base;