Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/utils.c')
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/utils.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/utils.c b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/utils.c
index 06ffd6b8c..d1dcc426d 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/utils.c
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/utils.c
@@ -328,6 +328,8 @@ int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){
}
s->internal_buffer_count++;
+ if(s->pkt) pic->pkt_pts= s->pkt->pts;
+ else pic->pkt_pts= AV_NOPTS_VALUE;
pic->reordered_opaque= s->reordered_opaque;
pic->reordered_opaque2= s->reordered_opaque2; /* ffdshow custom code */
pic->reordered_opaque3= s->reordered_opaque3; /* ffdshow custom code */
@@ -467,11 +469,13 @@ int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec)
goto end;
if (codec->priv_data_size > 0) {
+ if(!avctx->priv_data){
avctx->priv_data = av_mallocz(codec->priv_data_size);
if (!avctx->priv_data) {
ret = AVERROR(ENOMEM);
goto end;
}
+ }
} else {
avctx->priv_data = NULL;
}
@@ -583,12 +587,17 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
*got_picture_ptr= 0;
if((avctx->coded_width||avctx->coded_height) && av_image_check_size(avctx->coded_width, avctx->coded_height, 0, avctx))
return -1;
+
+ avctx->pkt = avpkt;
+
if((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size){
ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
avpkt);
emms_c(); //needed to avoid an emms_c() call before every return;
+ picture->pkt_dts= avpkt->dts;
+
if (*got_picture_ptr)
avctx->frame_number++;
}else
@@ -617,6 +626,8 @@ int attribute_align_arg avcodec_decode_audio3(AVCodecContext *avctx, int16_t *sa
{
int ret;
+ avctx->pkt = avpkt;
+
if((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size){
//FIXME remove the check below _after_ ensuring that all audio check that the available space is enough
if(*frame_size_ptr < AVCODEC_MAX_AUDIO_FRAME_SIZE){