summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2001-09-05 17:08:18 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2001-09-05 17:08:18 +0000
commit792cd6f291ddbc5da430d2273c7d9d5fcb1a8681 (patch)
tree1f87fb4100b2cbddd8e6041d2e014c21444ce620 /src
parent74e0dd85e141aec325cbf660775e1b40bc6ab338 (diff)
downloadxine-lib-792cd6f291ddbc5da430d2273c7d9d5fcb1a8681.tar.gz
xine-lib-792cd6f291ddbc5da430d2273c7d9d5fcb1a8681.tar.bz2
enable seeking in incomplete avis
CVS patchset: 568 CVS date: 2001/09/05 17:08:18
Diffstat (limited to 'src')
-rw-r--r--src/demuxers/demux_avi.c4
-rw-r--r--src/libffmpeg/libavcodec/h263dec.c8
-rw-r--r--src/libffmpeg/libavcodec/mpegvideo.c3
-rw-r--r--src/libffmpeg/libavcodec/mpegvideo.h2
4 files changed, 15 insertions, 2 deletions
diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c
index 737681df8..bc2066b6e 100644
--- a/src/demuxers/demux_avi.c
+++ b/src/demuxers/demux_avi.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: demux_avi.c,v 1.34 2001/09/04 16:19:27 guenter Exp $
+ * $Id: demux_avi.c,v 1.35 2001/09/05 17:08:18 guenter Exp $
*
* demultiplexer for avi streams
*
@@ -501,7 +501,7 @@ static avi_t *AVI_init(demux_avi_t *this)
|| ( (data[2]=='w' || data[2]=='W') &&
(data[3]=='b' || data[3]=='B') ) )
{
- avi_add_index_entry(this, AVI,data,0,this->input->seek(this->input, 0, SEEK_CUR)-8,n);
+ avi_add_index_entry(this, AVI, data, AVIIF_KEYFRAME, this->input->seek(this->input, 0, SEEK_CUR)-8, n);
}
this->input->seek(this->input, PAD_EVEN(n), SEEK_CUR);
diff --git a/src/libffmpeg/libavcodec/h263dec.c b/src/libffmpeg/libavcodec/h263dec.c
index 758f9ed52..ec14c09e2 100644
--- a/src/libffmpeg/libavcodec/h263dec.c
+++ b/src/libffmpeg/libavcodec/h263dec.c
@@ -114,6 +114,14 @@ static int h263_decode_frame(AVCodecContext *avctx,
if (ret < 0)
return -1;
+ /* make sure we start with an I-frame */
+ if (s->waiting_for_keyframe) {
+ if (s->pict_type != I_TYPE)
+ return -1;
+ else
+ s->waiting_for_keyframe = 0;
+ }
+
MPV_frame_start(s);
#ifdef DEBUG
diff --git a/src/libffmpeg/libavcodec/mpegvideo.c b/src/libffmpeg/libavcodec/mpegvideo.c
index 5c66b3189..9f7236f98 100644
--- a/src/libffmpeg/libavcodec/mpegvideo.c
+++ b/src/libffmpeg/libavcodec/mpegvideo.c
@@ -101,6 +101,8 @@ int MPV_common_init(MpegEncContext *s)
int c_size, i;
UINT8 *pict;
+ s->waiting_for_keyframe = 1;
+
if (s->out_format == FMT_H263)
s->dct_unquantize = dct_unquantize_h263_c;
else
@@ -212,6 +214,7 @@ int MPV_common_init(MpegEncContext *s)
if (s->aux_picture_base[i])
free(s->aux_picture_base[i]);
}
+
return -1;
}
diff --git a/src/libffmpeg/libavcodec/mpegvideo.h b/src/libffmpeg/libavcodec/mpegvideo.h
index 31243471e..9abe75a7c 100644
--- a/src/libffmpeg/libavcodec/mpegvideo.h
+++ b/src/libffmpeg/libavcodec/mpegvideo.h
@@ -181,6 +181,8 @@ typedef struct MpegEncContext {
DCTELEM block[6][64] __align8;
void (*dct_unquantize)(struct MpegEncContext *s,
DCTELEM *block, int n, int qscale);
+
+ int waiting_for_keyframe;
} MpegEncContext;
int MPV_common_init(MpegEncContext *s);