mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
ext/ffmpeg/gstffmpegmux.c: The ->frame_size for RAW audio is 1.
Original commit message from CVS: * ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_collected): The ->frame_size for RAW audio is 1. Should fix behaviour of some muxers.
This commit is contained in:
parent
d9b883110e
commit
f36390c258
2 changed files with 32 additions and 11 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2006-10-24 Edward Hervey <edward@fluendo.com>
|
||||||
|
|
||||||
|
* ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_collected):
|
||||||
|
The ->frame_size for RAW audio is 1.
|
||||||
|
Should fix behaviour of some muxers.
|
||||||
|
|
||||||
2006-10-24 Thomas Vander Stichele <thomas at apestaart dot org>
|
2006-10-24 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
* gst-ffmpeg.spec.in:
|
* gst-ffmpeg.spec.in:
|
||||||
|
|
|
@ -374,16 +374,31 @@ gst_ffmpegmux_collected (GstCollectPads * pads, gpointer user_data)
|
||||||
}
|
}
|
||||||
/* set framerate for audio */
|
/* set framerate for audio */
|
||||||
if (st->codec->codec_type == CODEC_TYPE_AUDIO) {
|
if (st->codec->codec_type == CODEC_TYPE_AUDIO) {
|
||||||
GstBuffer *buffer;
|
switch (st->codec->codec_id) {
|
||||||
|
case CODEC_ID_PCM_S16LE:
|
||||||
|
case CODEC_ID_PCM_S16BE:
|
||||||
|
case CODEC_ID_PCM_U16LE:
|
||||||
|
case CODEC_ID_PCM_U16BE:
|
||||||
|
case CODEC_ID_PCM_S8:
|
||||||
|
case CODEC_ID_PCM_U8:
|
||||||
|
st->codec->frame_size = 1;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
GstBuffer *buffer;
|
||||||
|
|
||||||
buffer = gst_collect_pads_peek (ffmpegmux->collect,
|
/* FIXME : This doesn't work for RAW AUDIO...
|
||||||
(GstCollectData *)collect_pad);
|
* in fact I'm wondering if it even works for any kind of audio... */
|
||||||
if (buffer) {
|
buffer = gst_collect_pads_peek (ffmpegmux->collect,
|
||||||
st->codec->frame_size =
|
(GstCollectData *)collect_pad);
|
||||||
st->codec->sample_rate *
|
if (buffer) {
|
||||||
GST_BUFFER_DURATION (buffer) / GST_SECOND;
|
st->codec->frame_size =
|
||||||
gst_buffer_unref (buffer);
|
st->codec->sample_rate *
|
||||||
}
|
GST_BUFFER_DURATION (buffer) / GST_SECOND;
|
||||||
|
gst_buffer_unref (buffer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -521,7 +536,7 @@ next_pad:
|
||||||
pkt.flags |= PKT_FLAG_KEY;
|
pkt.flags |= PKT_FLAG_KEY;
|
||||||
|
|
||||||
if (GST_BUFFER_DURATION_IS_VALID (buf))
|
if (GST_BUFFER_DURATION_IS_VALID (buf))
|
||||||
pkt.duration = GST_BUFFER_DURATION (buf) * AV_TIME_BASE / GST_SECOND;
|
pkt.duration = gst_util_uint64_scale_int(GST_BUFFER_DURATION (buf), AV_TIME_BASE, GST_SECOND);
|
||||||
else
|
else
|
||||||
pkt.duration = 0;
|
pkt.duration = 0;
|
||||||
av_write_frame (ffmpegmux->context, &pkt);
|
av_write_frame (ffmpegmux->context, &pkt);
|
||||||
|
|
Loading…
Reference in a new issue