diff --git a/subprojects/gst-plugins-good/gst/matroska/matroska-mux.c b/subprojects/gst-plugins-good/gst/matroska/matroska-mux.c index b0c7d77aa4..81e8d4d935 100644 --- a/subprojects/gst-plugins-good/gst/matroska/matroska-mux.c +++ b/subprojects/gst-plugins-good/gst/matroska/matroska-mux.c @@ -3853,7 +3853,7 @@ gst_matroska_mux_write_data (GstMatroskaMux * mux, GstMatroskaMuxPad * mux_pad, guint64 block_duration, duration_diff = 0; gboolean is_video_keyframe = FALSE; gboolean is_video_invisible = FALSE; - gboolean is_audio_only = FALSE; + gboolean is_audio_only = FALSE, is_audio = FALSE; gboolean is_min_duration_reached = FALSE; gboolean is_max_duration_exceeded = FALSE; gint flags = 0; @@ -3941,6 +3941,8 @@ gst_matroska_mux_write_data (GstMatroskaMux * mux, GstMatroskaMuxPad * mux_pad, gst_matroska_mux_pads_is_audio_only (GST_ELEMENT (mux)->sinkpads); GST_OBJECT_UNLOCK (mux); + is_audio = mux_pad->track->type == GST_MATROSKA_TRACK_TYPE_AUDIO; + is_min_duration_reached = (mux->min_cluster_duration == 0 || (buffer_timestamp > mux->cluster_time && (buffer_timestamp - mux->cluster_time) >= @@ -4102,7 +4104,7 @@ gst_matroska_mux_write_data (GstMatroskaMux * mux, GstMatroskaMuxPad * mux_pad, flags |= 0x08; if (mux->doctype_version > 1 && !write_duration && !cmeta) { - if (is_video_keyframe) + if (is_video_keyframe || is_audio) flags |= 0x80; hdr = diff --git a/subprojects/gst-plugins-good/tests/check/elements/matroskamux.c b/subprojects/gst-plugins-good/tests/check/elements/matroskamux.c index 412090bd92..c24251a286 100644 --- a/subprojects/gst-plugins-good/tests/check/elements/matroskamux.c +++ b/subprojects/gst-plugins-good/tests/check/elements/matroskamux.c @@ -59,8 +59,8 @@ seekable_sinkpad_query (GstPad * pad, GstObject * parent, GstQuery * query) #define compare_buffer_to_data(buffer, data, data_size) \ G_STMT_START { \ -fail_unless_equals_int (data_size, gst_buffer_get_size (buffer)); \ -fail_unless (gst_buffer_memcmp (buffer, 0, data, data_size) == 0); \ + fail_unless_equals_int (data_size, gst_buffer_get_size (buffer)); \ + fail_unless (gst_buffer_memcmp (buffer, 0, data, data_size) == 0);\ } G_STMT_END static void @@ -232,7 +232,7 @@ GST_END_TEST; GST_START_TEST (test_block_group_v2) { - guint8 data0_v2[] = { 0xa3, 0x85, 0x81, 0x00, 0x01, 0x00 }; + guint8 data0_v2[] = { 0xa3, 0x85, 0x81, 0x00, 0x01, 0x80 }; test_block_group_with_version (2, data0_v2, sizeof (data0_v2)); } @@ -311,10 +311,10 @@ GST_START_TEST (test_timecodescale) { GstBuffer *inbuffer, *outbuffer; guint8 data_h0[] = { - 0xa3, 0x85, 0x81, 0x00, 0x00, 0x00, + 0xa3, 0x85, 0x81, 0x00, 0x00, 0x80, }; guint8 data_h1[] = { - 0xa3, 0x85, 0x81, 0x00, 0x01, 0x00, + 0xa3, 0x85, 0x81, 0x00, 0x01, 0x80, }; GstHarness *h = setup_matroskamux_harness (AC3_CAPS_STRING);