diff options
author | Steve Baker <steve@stevebaker.org> | 2002-04-24 10:19:41 +0000 |
---|---|---|
committer | Steve Baker <steve@stevebaker.org> | 2002-04-24 10:19:41 +0000 |
commit | 559e8bc4eefcdad7685af27cf8a192cc6208d7fa (patch) | |
tree | d259866e245d660ec43b3ebdc83afb95c34cab0c /ext/audiofile/gstafparse.c | |
parent | fc5286e9c05407290891b4fd1755492a0f61e56e (diff) | |
download | gst-plugins-bad-559e8bc4eefcdad7685af27cf8a192cc6208d7fa.tar.gz gst-plugins-bad-559e8bc4eefcdad7685af27cf8a192cc6208d7fa.tar.bz2 gst-plugins-bad-559e8bc4eefcdad7685af27cf8a192cc6208d7fa.zip |
added a typefind function for all supported audiofile types.
Original commit message from CVS:
added a typefind function for all supported audiofile types.
the type is called audio/audiofile - I could have split it into seperate types like audio/aiff and audio/wave but there doesn't seem to be a way to have a padtemplate respond to more than one type, hence this umbrella type.
Also, fixed optimisation logic so that aiffs are read through the lib.
Diffstat (limited to 'ext/audiofile/gstafparse.c')
-rw-r--r-- | ext/audiofile/gstafparse.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/ext/audiofile/gstafparse.c b/ext/audiofile/gstafparse.c index adabd20a..11deb600 100644 --- a/ext/audiofile/gstafparse.c +++ b/ext/audiofile/gstafparse.c @@ -149,8 +149,7 @@ gst_afparse_init (GstAFParse *afparse) afparse->vfile->seek = gst_afparse_vf_seek; afparse->vfile->tell = gst_afparse_vf_tell; - /* default to low latency */ - afparse->frames_per_read = 64; + afparse->frames_per_read = 1024; afparse->curoffset = 0; afparse->seq = 0; @@ -175,6 +174,7 @@ gst_afparse_loop(GstElement *element) guint8 *data; gboolean bypass_afread = TRUE; GstByteStream *bs; + int s_format, v_format, s_width, v_width; afparse = GST_AFPARSE(element); @@ -191,15 +191,15 @@ gst_afparse_loop(GstElement *element) /* if audiofile changes the data in any way, we have to access * the audio data via afReadFrames. Otherwise we can just access * the data directly. */ + afGetSampleFormat(afparse->file, AF_DEFAULT_TRACK, &s_format, &s_width); + afGetVirtualSampleFormat(afparse->file, AF_DEFAULT_TRACK, &v_format, &v_width); if (afGetCompression != AF_COMPRESSION_NONE || - afGetByteOrder(afparse->file, AF_DEFAULT_TRACK) != afGetVirtualByteOrder(afparse->file, AF_DEFAULT_TRACK)){ - int s_format, v_format, s_width, v_width; - afGetSampleFormat(afparse->file, AF_DEFAULT_TRACK, &s_format, &s_width); - afGetVirtualSampleFormat(afparse->file, AF_DEFAULT_TRACK, &v_format, &v_width); - if (s_format != v_format || s_width != v_width){ - bypass_afread = FALSE; - } + afGetByteOrder(afparse->file, AF_DEFAULT_TRACK) != afGetVirtualByteOrder(afparse->file, AF_DEFAULT_TRACK) || + s_format != v_format || + s_width != v_width){ + bypass_afread = FALSE; } + if (bypass_afread){ g_print("will bypass afReadFrames\n"); } @@ -226,9 +226,10 @@ gst_afparse_loop(GstElement *element) break; } } - - gst_pad_push (afparse->srcpad, buf); - afparse->timestamp += numframes * 1E9 / afparse->rate; + else { + gst_pad_push (afparse->srcpad, buf); + afparse->timestamp += numframes * 1E9 / afparse->rate; + } } while (TRUE); @@ -255,7 +256,6 @@ gst_afparse_loop(GstElement *element) } while (TRUE); } - gst_afparse_close_file (afparse); gst_buffer_pool_unref(bufpool); |