Commit ea118a8d authored by Ronald S. Bultje's avatar Ronald S. Bultje
Browse files

ext/flac/gstflacdec.c: Only return true if we actually filled something in....

ext/flac/gstflacdec.c: Only return true if we actually filled something in. Prevents player applications from showing...

Original commit message from CVS:
* ext/flac/gstflacdec.c: (gst_flacdec_src_query):
Only return true if we actually filled something in. Prevents
player applications from showing a random length for flac files.
* gst-libs/gst/riff/riff-read.c: (gst_riff_read_class_init),
(gst_riff_read_use_event), (gst_riff_read_handle_event),
(gst_riff_read_seek), (gst_riff_read_skip), (gst_riff_read_strh),
(gst_riff_read_strf_vids_with_data),
(gst_riff_read_strf_auds_with_data), (gst_riff_read_strf_iavs):
OK, ok, so I implemented event handling. Apparently it's normal
that we receive random events at random points without asking
for it.
* gst/avi/gstavidemux.c: (gst_avi_demux_reset),
(gst_avi_demux_src_convert), (gst_avi_demux_handle_src_query),
(gst_avi_demux_handle_src_event), (gst_avi_demux_stream_index),
(gst_avi_demux_sync), (gst_avi_demux_stream_scan),
(gst_avi_demux_massage_index), (gst_avi_demux_stream_header),
(gst_avi_demux_handle_seek), (gst_avi_demux_process_next_entry),
(gst_avi_demux_stream_data), (gst_avi_demux_loop):
* gst/avi/gstavidemux.h:
Implement non-lineair chunk handling and subchunk processing.
The first solves playback of AVI files where the audio and video
data of individual buffers that we read are not synchronized.
This should not happen according to the wonderful AVI specs, but
of course it does happen in reality. It is also a prerequisite for
the second. Subchunk processing allows us to cut chunks in small
pieces and process each of these pieces separately. This is
required because I've seen several AVI files with incredibly large
audio chunks, even some files with only one audio chunk for the
whole file. This allows for proper playback including seeking.
This patch is supposed to fix all AVI A/V sync issues.
* gst/flx/gstflxdec.c: (gst_flxdec_class_init),
(flx_decode_chunks), (flx_decode_color), (gst_flxdec_loop):
Work.
* gst/modplug/gstmodplug.cc:
Proper return value setting for the query() function.
* gst/playback/gstplaybasebin.c: (setup_source):
Being in non-playing state (after, e.g., EOS) is not necessarily
a bad thing. Allow for that. This fixes playback of short files.
They don't actually playback fully now, because the clock already
runs. This means that small files (<500kB) with a small length
(<2sec) will still not or barely play. Other files, such as mod
or flx, will work correctly, however.
parent d737e1db
2004-09-29 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/flac/gstflacdec.c: (gst_flacdec_src_query):
Only return true if we actually filled something in. Prevents
player applications from showing a random length for flac files.
* gst-libs/gst/riff/riff-read.c: (gst_riff_read_class_init),
(gst_riff_read_use_event), (gst_riff_read_handle_event),
(gst_riff_read_seek), (gst_riff_read_skip), (gst_riff_read_strh),
(gst_riff_read_strf_vids_with_data),
(gst_riff_read_strf_auds_with_data), (gst_riff_read_strf_iavs):
OK, ok, so I implemented event handling. Apparently it's normal
that we receive random events at random points without asking
for it.
* gst/avi/gstavidemux.c: (gst_avi_demux_reset),
(gst_avi_demux_src_convert), (gst_avi_demux_handle_src_query),
(gst_avi_demux_handle_src_event), (gst_avi_demux_stream_index),
(gst_avi_demux_sync), (gst_avi_demux_stream_scan),
(gst_avi_demux_massage_index), (gst_avi_demux_stream_header),
(gst_avi_demux_handle_seek), (gst_avi_demux_process_next_entry),
(gst_avi_demux_stream_data), (gst_avi_demux_loop):
* gst/avi/gstavidemux.h:
Implement non-lineair chunk handling and subchunk processing.
The first solves playback of AVI files where the audio and video
data of individual buffers that we read are not synchronized.
This should not happen according to the wonderful AVI specs, but
of course it does happen in reality. It is also a prerequisite for
the second. Subchunk processing allows us to cut chunks in small
pieces and process each of these pieces separately. This is
required because I've seen several AVI files with incredibly large
audio chunks, even some files with only one audio chunk for the
whole file. This allows for proper playback including seeking.
This patch is supposed to fix all AVI A/V sync issues.
* gst/flx/gstflxdec.c: (gst_flxdec_class_init),
(flx_decode_chunks), (flx_decode_color), (gst_flxdec_loop):
Work.
* gst/modplug/gstmodplug.cc:
Proper return value setting for the query() function.
* gst/playback/gstplaybasebin.c: (setup_source):
Being in non-playing state (after, e.g., EOS) is not necessarily
a bad thing. Allow for that. This fixes playback of short files.
They don't actually playback fully now, because the clock already
runs. This means that small files (<500kB) with a small length
(<2sec) will still not or barely play. Other files, such as mod
or flx, will work correctly, however.
2004-09-28 Wim Taymans <wim@fluendo.com>
* ext/speex/gstspeex.c: (plugin_init):
......
......@@ -700,12 +700,12 @@ gst_flacdec_src_query (GstPad * pad, GstQueryType type,
else
samples = flacdec->stream_samples;
gst_pad_convert (flacdec->srcpad,
res = gst_pad_convert (flacdec->srcpad,
GST_FORMAT_DEFAULT, samples, format, value);
break;
}
case GST_QUERY_POSITION:
gst_pad_convert (flacdec->srcpad,
res = gst_pad_convert (flacdec->srcpad,
GST_FORMAT_DEFAULT, flacdec->total_samples, format, value);
break;
default:
......
This diff is collapsed.
......@@ -47,9 +47,9 @@ G_BEGIN_DECLS
typedef struct {
gint index_nr;
gint stream_nr;
guint64 ts;
guint64 ts, dur;
guint32 flags;
guint32 offset;
guint64 offset;
gint size;
guint64 bytes_before;
guint32 frames_before;
......@@ -100,6 +100,7 @@ typedef struct _GstAviDemux {
gst_avi_index_entry *index_entries;
guint index_size;
guint64 index_offset;
guint current_entry;
/* streams */
guint num_streams;
......@@ -114,6 +115,8 @@ typedef struct _GstAviDemux {
/* seeking */
guint64 seek_offset;
guint64 last_seek;
gint seek_entry;
gboolean seek_flush;
} GstAviDemux;
typedef struct _GstAviDemuxClass {
......
......@@ -28,6 +28,9 @@
#define JIFFIE (GST_SECOND/70)
GST_DEBUG_CATEGORY_STATIC (flxdec_debug);
#define GST_CAT_DEFAULT flxdec_debug
/* flx element information */
static GstElementDetails flxdec_details = {
"FLX Decoder",
......@@ -133,6 +136,8 @@ gst_flxdec_class_init (GstFlxDecClass * klass)
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
GST_DEBUG_CATEGORY_INIT (flxdec_debug, "flxdec", 0, "FLX video decoder");
gobject_class->set_property = gst_flxdec_set_property;
gobject_class->get_property = gst_flxdec_get_property;
......@@ -206,9 +211,8 @@ flx_decode_chunks (GstFlxDec * flxdec, gulong count, gchar * data, gchar * dest)
break;
default:
g_print ("GstFlxDec: Unimplented chunk type: 0x%02x size: %d\n",
GST_WARNING ("Unimplented chunk type: 0x%02x size: %d - skipping",
hdr->id, hdr->size);
g_print ("GstFlxDec: Skipping...\n");
data += rndalign (hdr->size) - FlxFrameChunkSize;
break;
}
......@@ -228,7 +232,7 @@ flx_decode_color (GstFlxDec * flxdec, guchar * data, guchar * dest, gint scale)
data += 2;
indx = 0;
g_print ("GstFlxDec: cmap packs: %d\n", packs);
GST_LOG ("GstFlxDec: cmap packs: %d", packs);
while (packs--) {
/* color map index + skip count */
indx += *data++;
......@@ -238,7 +242,7 @@ flx_decode_color (GstFlxDec * flxdec, guchar * data, guchar * dest, gint scale)
if (count == 0)
count = 256;
g_print ("GstFlxDec: cmap count: %d (indx: %d)\n", count, indx);
GST_LOG ("GstFlxDec: cmap count: %d (indx: %d)\n", count, indx);
flx_set_palette_vector (flxdec->converter, indx, count, data, scale);
data += (count * 3);
......@@ -449,7 +453,7 @@ gst_flxdec_loop (GstElement * element)
databuf = flx_get_data (flxdec, FlxHeaderSize);
if (!databuf) {
g_print ("empty buffer\n");
GST_LOG ("empty buffer");
return;
}
......@@ -470,12 +474,12 @@ gst_flxdec_loop (GstElement * element)
}
g_print ("GstFlxDec: size : %d\n", flxh->size);
g_print ("GstFlxDec: frames : %d\n", flxh->frames);
g_print ("GstFlxDec: width : %d\n", flxh->width);
g_print ("GstFlxDec: height : %d\n", flxh->height);
g_print ("GstFlxDec: depth : %d\n", flxh->depth);
g_print ("GstFlxDec: speed : %d\n", flxh->speed);
GST_LOG ("size : %d\n", flxh->size);
GST_LOG ("frames : %d\n", flxh->frames);
GST_LOG ("width : %d\n", flxh->width);
GST_LOG ("height : %d\n", flxh->height);
GST_LOG ("depth : %d\n", flxh->depth);
GST_LOG ("speed : %d\n", flxh->speed);
flxdec->next_time = 0;
......@@ -496,10 +500,10 @@ gst_flxdec_loop (GstElement * element)
flx_colorspace_converter_new (flxh->width, flxh->height);
if (flxh->type == FLX_MAGICHDR_FLC || flxh->type == FLX_MAGICHDR_FLX) {
g_print ("GstFlxDec: (FLC) aspect_dx : %d\n", flxh->aspect_dx);
g_print ("GstFlxDec: (FLC) aspect_dy : %d\n", flxh->aspect_dy);
g_print ("GstFlxDec: (FLC) oframe1 : 0x%08x\n", flxh->oframe1);
g_print ("GstFlxDec: (FLC) oframe2 : 0x%08x\n", flxh->oframe2);
GST_LOG ("(FLC) aspect_dx : %d\n", flxh->aspect_dx);
GST_LOG ("(FLC) aspect_dy : %d\n", flxh->aspect_dy);
GST_LOG ("(FLC) oframe1 : 0x%08x\n", flxh->oframe1);
GST_LOG ("(FLC) oframe2 : 0x%08x\n", flxh->oframe2);
}
flxdec->size = (flxh->width * flxh->height);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment