flacparse: Adjust unit tests to new flacparse behaviour
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Tue, 12 Oct 2010 08:28:33 +0000 (10:28 +0200)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Fri, 8 Apr 2011 17:07:11 +0000 (18:07 +0100)
Garbage after frames is now included in the frames because flacparse
has no easy way to detect the real end of a frame. Decoders are
expected to everything after the frame because only decoding the
bitstream will reveal the real end of the frame.

Fixes bug #631814.

tests/check/elements/flacparse.c

index 1875435..0c25bc6 100644 (file)
@@ -142,8 +142,19 @@ GST_END_TEST;
 
 GST_START_TEST (test_parse_flac_drain_garbage)
 {
+  /* We always output the after frame garbage too because we
+   * have no way of detecting it
+   */
+#if 0
   gst_parser_test_drain_garbage (flac_frame, sizeof (flac_frame),
       garbage_frame, sizeof (garbage_frame));
+#endif
+  guint8 frame[sizeof (flac_frame) + sizeof (garbage_frame)];
+
+  memcpy (frame, flac_frame, sizeof (flac_frame));
+  memcpy (frame + sizeof (flac_frame), garbage_frame, sizeof (garbage_frame));
+
+  gst_parser_test_drain_single (frame, sizeof (frame));
 }
 
 GST_END_TEST;
@@ -159,8 +170,20 @@ GST_END_TEST;
 
 GST_START_TEST (test_parse_flac_skip_garbage)
 {
+  /* We always include the garbage into the frame because
+   * we have no easy way for finding the real end of the
+   * frame. The decoder will later skip the garbage
+   */
+#if 0
   gst_parser_test_skip_garbage (flac_frame, sizeof (flac_frame),
       garbage_frame, sizeof (garbage_frame));
+#endif
+  guint8 frame[sizeof (flac_frame) + sizeof (garbage_frame)];
+
+  memcpy (frame, flac_frame, sizeof (flac_frame));
+  memcpy (frame + sizeof (flac_frame), garbage_frame, sizeof (garbage_frame));
+
+  gst_parser_test_normal (frame, sizeof (frame));
 }
 
 GST_END_TEST;