diff options
author | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2003-05-14 21:59:18 +0000 |
---|---|---|
committer | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2003-05-14 21:59:18 +0000 |
commit | 5a77a54a5ac4887a30cf20c95293ee45605ae20d (patch) | |
tree | 1af52bca57f653552ffc7315a7d956fae69889ed /gst | |
parent | 82f3d590000b52aefbf3deff33d34e76e15e441b (diff) |
PCM data in AVI is always little endian
Original commit message from CVS:
PCM data in AVI is always little endian
Diffstat (limited to 'gst')
-rw-r--r-- | gst/avi/gstavidemux.c | 4 | ||||
-rw-r--r-- | gst/avi/gstavimux.c | 20 |
2 files changed, 19 insertions, 5 deletions
diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c index 894d1571..f7ab3af3 100644 --- a/gst/avi/gstavidemux.c +++ b/gst/avi/gstavidemux.c @@ -127,7 +127,7 @@ GST_PAD_TEMPLATE_FACTORY (src_audio_templ, "audio/raw", "format", GST_PROPS_STRING ("int"), "law", GST_PROPS_INT (0), - "endianness", GST_PROPS_INT (G_BYTE_ORDER), + "endianness", GST_PROPS_INT (G_LITTLE_ENDIAN), "signed", GST_PROPS_LIST ( GST_PROPS_BOOLEAN (TRUE), GST_PROPS_BOOLEAN (FALSE) @@ -786,7 +786,7 @@ gst_avi_demux_strf_auds (GstAviDemux *avi_demux) gst_props_new ( "format", GST_PROPS_STRING ("int"), "law", GST_PROPS_INT (0), - "endianness", GST_PROPS_INT (G_BYTE_ORDER), + "endianness", GST_PROPS_INT (G_LITTLE_ENDIAN), "signed", GST_PROPS_BOOLEAN ((GUINT16_FROM_LE (strf->size) != 8)), "width", GST_PROPS_INT ((GUINT16_FROM_LE (strf->blockalign)*8) / GUINT16_FROM_LE (strf->channels)), diff --git a/gst/avi/gstavimux.c b/gst/avi/gstavimux.c index 750a5125..ef8d4a66 100644 --- a/gst/avi/gstavimux.c +++ b/gst/avi/gstavimux.c @@ -419,19 +419,27 @@ gst_avimux_sinkconnect (GstPad *pad, GstCaps *vscaps) } else if (!strcmp (mimetype, "audio/x-mp3")) { - gint layer; + gint layer = 3; - gst_caps_get_int(caps, "layer", &layer); + if (gst_caps_has_property(caps, "layer")) + gst_caps_get_int(caps, "layer", &layer); + else + GST_DEBUG(GST_CAT_PLUGIN_INFO, + "No layer specified, assuming layer 3"); /* we don't need to do anything here, compressed mp3 contains it all */ avimux->auds.format = (layer == 3? GST_RIFF_WAVE_FORMAT_MPEGL3 : GST_RIFF_WAVE_FORMAT_MPEGL12); + avimux->auds_hdr.scale = avimux->auds_hdr.samplesize = 1; + avimux->auds_hdr.rate = avimux->auds.av_bps = 0; goto done; } else if (!strcmp (mimetype, "application/x-ogg")) { avimux->auds.format = GST_RIFF_WAVE_FORMAT_VORBIS1; + avimux->auds_hdr.scale = avimux->auds_hdr.samplesize = 1; + avimux->auds_hdr.rate = avimux->auds.av_bps = 0; goto done; } } @@ -969,8 +977,14 @@ gst_avimux_stop_file (GstAviMux *avimux) /* set rate and everything having to do with that */ avimux->avi_hdr.us_frame = avimux->vids_hdr.scale = 1000000/avimux->framerate; avimux->avi_hdr.max_bps = 0; - if (avimux->audio_pad_connected) + if (avimux->audio_pad_connected) { + /* calculate bps if needed */ + if (!avimux->auds.av_bps) { + g_warning("Bps calculation needed!"); + avimux->auds_hdr.rate = avimux->auds.av_bps * avimux->auds_hdr.scale; + } avimux->avi_hdr.max_bps += avimux->auds.av_bps; + } if (avimux->video_pad_connected) avimux->avi_hdr.max_bps += ((avimux->vids.bit_cnt+7)/8) * avimux->framerate * |