{
u32 at_type, size;
size = gf_bs_read_u32(bs);
-@@ -236,10 +236,10 @@ static GF_Err FFDEC_AttachStream(GF_Base
+@@ -239,10 +239,10 @@ static GF_Err FFDEC_AttachStream(GF_Base
(*ctx)->codec_type = AVMEDIA_TYPE_VIDEO;
switch (ffd->oti) {
case GPAC_OTI_VIDEO_MPEG4_PART2:
break;
#ifdef HAS_HEVC
case GPAC_OTI_VIDEO_HEVC:
-@@ -253,14 +253,14 @@ static GF_Err FFDEC_AttachStream(GF_Base
+@@ -256,14 +256,14 @@ static GF_Err FFDEC_AttachStream(GF_Base
case GPAC_OTI_VIDEO_MPEG2_SPATIAL:
case GPAC_OTI_VIDEO_MPEG2_HIGH:
case GPAC_OTI_VIDEO_MPEG2_422:
break;
}
} else if (ffd->st==GF_STREAM_AUDIO) {
-@@ -269,12 +269,12 @@ static GF_Err FFDEC_AttachStream(GF_Base
+@@ -272,12 +272,12 @@ static GF_Err FFDEC_AttachStream(GF_Base
case GPAC_OTI_AUDIO_MPEG2_PART3:
case GPAC_OTI_AUDIO_MPEG1:
(*ctx)->frame_size = 1152;
}
*codec = avcodec_find_decoder(codec_id);
}
-@@ -357,8 +357,8 @@ static GF_Err FFDEC_AttachStream(GF_Base
-
- }
+@@ -363,8 +363,8 @@ static GF_Err FFDEC_AttachStream(GF_Base
#endif //HAS_HEVC
+ if (!ffd->output_cb_size) ffd->output_cb_size = 4;
+
- if (codec_id == CODEC_ID_RAWVIDEO) {
- (*ctx)->codec_id = CODEC_ID_RAWVIDEO;
+ if (codec_id == AV_CODEC_ID_RAWVIDEO) {
+ (*ctx)->codec_id = AV_CODEC_ID_RAWVIDEO;
(*ctx)->pix_fmt = ffd->raw_pix_fmt;
- if ((*ctx)->extradata && strstr((*ctx)->extradata, "BottomUp")) ffd->flipped = 1;
+ if ((*ctx)->extradata && strstr((char *) (*ctx)->extradata, "BottomUp")) ffd->flipped = 1;
} else {
-@@ -370,7 +370,7 @@ static GF_Err FFDEC_AttachStream(GF_Base
+@@ -376,7 +376,7 @@ static GF_Err FFDEC_AttachStream(GF_Base
}
/*setup audio streams*/
if (ffd->st==GF_STREAM_AUDIO) {
(*ctx)->frame_size = ((*ctx)->sample_rate > 24000) ? 1152 : 576;
}
/*may be 0 (cfg not known yet)*/
-@@ -384,17 +384,17 @@ static GF_Err FFDEC_AttachStream(GF_Base
+@@ -390,17 +390,17 @@ static GF_Err FFDEC_AttachStream(GF_Base
} else {
switch ((*codec)->id) {
*frame = avcodec_alloc_frame();
#ifdef USE_AVCODEC2
{
-@@ -752,7 +752,7 @@ redecode:
+@@ -783,7 +783,7 @@ redecode:
}
if (*outBufferLength != ffd->out_size) {
*outBufferLength = ffd->out_size;
return GF_BUFFER_TOO_SMALL;
-@@ -849,7 +849,7 @@ redecode:
+@@ -880,7 +880,7 @@ redecode:
/*OK we loose the DSI stored in the codec context, but H263 doesn't need any, and if we're
here this means the DSI was broken, so no big deal*/
avcodec_close(ctx);
#ifdef USE_AVCTX3
if (! (*codec) || (avcodec_open2(ctx, *codec, NULL)<0)) return GF_NON_COMPLIANT_BITSTREAM;
-@@ -1132,9 +1132,9 @@ static u32 FFDEC_CanHandleStream(GF_Base
+@@ -1200,9 +1200,9 @@ static u32 FFDEC_CanHandleStream(GF_Base
}
else if (StreamType==GF_STREAM_AUDIO) {
/*std MPEG-2 audio*/
}
/*std MPEG-4 visual*/
-@@ -1171,10 +1171,10 @@ static u32 FFDEC_CanHandleStream(GF_Base
+@@ -1239,10 +1239,10 @@ static u32 FFDEC_CanHandleStream(GF_Base
switch (ffd->oti) {
/*MPEG-4 v1 simple profile*/
#ifdef HAS_HEVC
case GPAC_OTI_VIDEO_HEVC:
codec_id = AV_CODEC_ID_HEVC; break;
-@@ -1188,10 +1188,10 @@ static u32 FFDEC_CanHandleStream(GF_Base
+@@ -1256,10 +1256,10 @@ static u32 FFDEC_CanHandleStream(GF_Base
case GPAC_OTI_VIDEO_MPEG2_SPATIAL:
case GPAC_OTI_VIDEO_MPEG2_HIGH:
case GPAC_OTI_VIDEO_MPEG2_422:
#define av_find_stream_info(__c) avformat_find_stream_info(__c, NULL)
#ifndef FF_API_FORMAT_PARAMETERS
-@@ -353,7 +353,7 @@ static Bool FFD_CanHandleURL(GF_InputSer
+@@ -314,7 +314,7 @@ static Bool FFD_CanHandleURL(GF_InputSer
}
exit:
return ret;
}
-@@ -372,13 +372,13 @@ static GF_ESD *FFD_GetESDescriptor(FFDem
+@@ -333,13 +333,13 @@ static GF_ESD *FFD_GetESDescriptor(FFDem
AVCodecContext *dec = ffd->ctx->streams[ffd->audio_st]->codec;
esd->slConfig->timestampResolution = ffd->audio_tscale.den;
switch (dec->codec_id) {
if (!dec->extradata_size) goto opaque_audio;
esd->decoderConfig->objectTypeIndication = GPAC_OTI_AUDIO_AAC_MPEG4;
esd->decoderConfig->decoderSpecificInfo->dataLength = dec->extradata_size;
-@@ -413,25 +413,25 @@ opaque_audio:
+@@ -374,25 +374,25 @@ opaque_audio:
AVCodecContext *dec = ffd->ctx->streams[ffd->video_st]->codec;
esd->slConfig->timestampResolution = ffd->video_tscale.den;
switch (dec->codec_id) {
esd->decoderConfig->objectTypeIndication = GPAC_OTI_VIDEO_MPEG2_422;
break;
default:
-@@ -629,11 +629,7 @@ static GF_Err FFD_ConnectService(GF_Inpu
+@@ -590,11 +590,7 @@ static GF_Err FFD_ConnectService(GF_Inpu
}
/*setup downloader*/
av_in->flags |= AVFMT_NOFILE;
}
} else {
res = open_file(&ffd->ctx, szName, av_in);
-@@ -712,7 +708,7 @@ static GF_Err FFD_ConnectService(GF_Inpu
+@@ -673,7 +669,7 @@ static GF_Err FFD_ConnectService(GF_Inpu
ffd->seekable = (av_seek_frame(ffd->ctx, -1, 0, AVSEEK_FLAG_BACKWARD)<0) ? 0 : 1;
if (!ffd->seekable) {
ffd->ctx = NULL;
open_file(&ffd->ctx, szName, av_in);
av_find_stream_info(ffd->ctx);
-@@ -727,7 +723,7 @@ static GF_Err FFD_ConnectService(GF_Inpu
+@@ -688,7 +684,7 @@ static GF_Err FFD_ConnectService(GF_Inpu
err_exit:
GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("[FFMPEG] Error opening file %s: %s\n", url, gf_error_to_string(e)));
ffd->ctx = NULL;
gf_term_on_connect(serv, NULL, e);
return GF_OK;
-@@ -781,7 +777,7 @@ static GF_Err FFD_CloseService(GF_InputS
+@@ -742,7 +738,7 @@ static GF_Err FFD_CloseService(GF_InputS
ffd->is_running = 0;