mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
avauddec: address regression with WMA files ..
By outputting lead-in samples that FFmpeg now would like us to ignore, and discarding trailing samples that it would now like us to output. See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1474 Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1348 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3117>
This commit is contained in:
parent
9abceda343
commit
235be306fd
1 changed files with 16 additions and 5 deletions
|
@ -221,6 +221,14 @@ gst_ffmpegauddec_start (GstAudioDecoder * decoder)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
ffmpegdec->context->opaque = ffmpegdec;
|
ffmpegdec->context->opaque = ffmpegdec;
|
||||||
|
|
||||||
|
/* FIXME: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1474 */
|
||||||
|
if ((oclass->in_plugin->capabilities & AV_CODEC_CAP_DELAY) != 0
|
||||||
|
&& (oclass->in_plugin->id == AV_CODEC_ID_WMAV1
|
||||||
|
|| oclass->in_plugin->id == AV_CODEC_ID_WMAV2)) {
|
||||||
|
ffmpegdec->context->flags2 |= AV_CODEC_FLAG2_SKIP_MANUAL;
|
||||||
|
}
|
||||||
|
|
||||||
GST_OBJECT_UNLOCK (ffmpegdec);
|
GST_OBJECT_UNLOCK (ffmpegdec);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -608,11 +616,14 @@ gst_ffmpegauddec_drain (GstFFMpegAudDec * ffmpegdec, gboolean force)
|
||||||
if (avcodec_send_packet (ffmpegdec->context, NULL))
|
if (avcodec_send_packet (ffmpegdec->context, NULL))
|
||||||
goto send_packet_failed;
|
goto send_packet_failed;
|
||||||
|
|
||||||
do {
|
/* FIXME: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1474 */
|
||||||
got_frame = gst_ffmpegauddec_frame (ffmpegdec, &ret, &need_more_data);
|
if (!(ffmpegdec->context->flags2 & AV_CODEC_FLAG2_SKIP_MANUAL)) {
|
||||||
if (got_frame)
|
do {
|
||||||
got_any_frames = TRUE;
|
got_frame = gst_ffmpegauddec_frame (ffmpegdec, &ret, &need_more_data);
|
||||||
} while (got_frame && !need_more_data);
|
if (got_frame)
|
||||||
|
got_any_frames = TRUE;
|
||||||
|
} while (got_frame && !need_more_data);
|
||||||
|
}
|
||||||
avcodec_flush_buffers (ffmpegdec->context);
|
avcodec_flush_buffers (ffmpegdec->context);
|
||||||
|
|
||||||
/* FFMpeg will return AVERROR_EOF if it's internal was fully drained
|
/* FFMpeg will return AVERROR_EOF if it's internal was fully drained
|
||||||
|
|
Loading…
Reference in a new issue