+2004-09-20 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
+
+ * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps),
+ (gst_ffmpeg_caps_with_codecid):
+ WMV extradata (make #152798 work). J-frames are only available
+ in the bitstream if the J-frame bit has been set in the extradata.
+ If not (or if extradata is not provided), the movie won't play.
+ * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_close),
+ (gst_ffmpegdec_connect), (gst_ffmpegdec_chain):
+ Only close ffmpeg if privdata was allocated (else it segfaults).
+ Autodetect encoding bugs and workaround it. Don't copy data if
+ decoding failed.
+ * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_loop):
+ Use read_frame() instead of read_packet() which is obsolete.
+
2004-09-16 Iain <iaingnome@gmail.com>
* ext/ffmpeg/gstffmpegmux.c (gst_ffmpegmux_register): Free name fix
-Subproject commit 5ec931d243c53ddda5b2cbb9a2c21ce89747bcb4
+Subproject commit ded6dc5186cb7f8c64cb06a8591b9f787122c6f1
do {
gint version = (codec_id == CODEC_ID_WMV1) ? 1 : 2;
- if (context)
+ if (context && context->extradata_size)
{
GstBuffer *buffer;
do {
gint version = (codec_id == CODEC_ID_WMAV1) ? 1 : 2;
- if (context)
+ if (context && context->extradata_size)
{
GstBuffer *buffer;
"codec_data", GST_TYPE_BUFFER, buffer,
"block_align", G_TYPE_INT, context->block_align,
"bitrate", G_TYPE_INT, context->bit_rate, NULL);
- }
- else
- {
+ } else {
caps = GST_FF_AUD_CAPS_NEW ("audio/x-wma",
"wmaversion", G_TYPE_INT, version,
"block_align", GST_TYPE_INT_RANGE, 0, G_MAXINT,
case CODEC_ID_WMAV1:
case CODEC_ID_WMAV2:
+ case CODEC_ID_WMV1:
+ case CODEC_ID_WMV2:
do {
const GValue *value;
const GstBuffer *buf;
if (!ffmpegdec->opened)
return;
- avcodec_close (ffmpegdec->context);
+ if (ffmpegdec->context->priv_data)
+ avcodec_close (ffmpegdec->context);
ffmpegdec->opened = FALSE;
if (ffmpegdec->context->palctrl) {
/* do *not* draw edges */
ffmpegdec->context->flags |= CODEC_FLAG_EMU_EDGE;
+ /* workaround encoder bugs */
+ ffmpegdec->context->workaround_bugs |= FF_BUG_AUTODETECT;
+
/* open codec - we don't select an output pix_fmt yet,
* simply because we don't know! We only get it
* during playback... */
data = GST_BUFFER_DATA (inbuf);
size = GST_BUFFER_SIZE (inbuf);
}
+
len = avcodec_decode_video (ffmpegdec->context,
ffmpegdec->picture, &have_data, data, size);
- if (have_data) {
+
+ if (len >= 0 && have_data) {
/* libavcodec constantly crashes on stupid buffer allocation
* errors inside. This drives me crazy, so we let it allocate
* it's own buffers and copy to our own buffer afterwards... */
}
/* read a package */
- res = av_read_packet (demux->context, &pkt);
+ res = av_read_frame (demux->context, &pkt);
if (res < 0) {
#if 0
/* This doesn't work - FIXME */