[SCM] libav/experimental: last frame decoding fix
siretart at users.alioth.debian.org
siretart at users.alioth.debian.org
Sun Jun 30 15:36:55 UTC 2013
The following commit has been merged in the experimental branch:
commit e9174ba460aee4dd6b90ad598ebbaea683f774bf
Author: Michael Niedermayer <michaelni at gmx.at>
Date: Wed Jul 23 09:58:02 2003 +0000
last frame decoding fix
Originally committed as revision 2074 to svn://svn.ffmpeg.org/ffmpeg/trunk
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index aee93e8..01defcd 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -401,9 +401,17 @@ uint64_t time= rdtsc();
s->flags= avctx->flags;
*data_size = 0;
-
- /* no supplementary picture */
+
+ /* no supplementary picture */
if (buf_size == 0) {
+ /* special case for last picture */
+ if (s->low_delay==0 && s->next_picture_ptr) {
+ *pict= *(AVFrame*)s->next_picture_ptr;
+ s->next_picture_ptr= NULL;
+
+ *data_size = sizeof(AVFrame);
+ }
+
return 0;
}
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index e84fa55..9967850 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -2231,12 +2231,11 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
*data_size = 0;
/* special case for last picture */
- if (buf_size == 0) {
- if (s2->picture_number > 0) {
- *picture= *(AVFrame*)&s2->next_picture;
+ if (buf_size == 0 && s2->low_delay==0 && s2->next_picture_ptr) {
+ *picture= *(AVFrame*)s2->next_picture_ptr;
+ s2->next_picture_ptr= NULL;
- *data_size = sizeof(AVFrame);
- }
+ *data_size = sizeof(AVFrame);
return 0;
}
--
Libav/FFmpeg packaging
More information about the pkg-multimedia-commits
mailing list