[gstreamer-bugs] [Bug 415446] [avidemux] fails parsing mjpeg file from digital camera

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Tue Mar 6 19:09:16 PST 2007


Do not reply to this via email (we are currently unable to handle email
responses and they get discarded).  You can add comments to this bug at
http://bugzilla.gnome.org/show_bug.cgi?id=415446

  GStreamer | gst-plugins-good | Ver: HEAD CVS





------- Comment #2 from René Stadler  2007-03-07 03:07 UTC -------
Created an attachment (id=84135)
 --> (http://bugzilla.gnome.org/attachment.cgi?id=84135&action=view)
Make avidemux accept optional header chunks in any order

The problem is that avidemux does not like the fact that the strd chunk
precedes the strh chunk.  The current parsing logic as implemented in
gst_avi_demux_parse_stream is as follows:

parse_chunk (&tag)
if tag != strh:
  goto fail
parse_strh ();

parse_chunk (&tag)
if tag != strf:
  goto fail
do_strh_and_strf_stuff ()

while parse_chunk (&tag):
  switch tag:
    case strd:
       do_strd_stuff ()
       break;
    case other_tags:
       do_other_tag_stuff ();
       break;


The patch collates this into a single while loop, leaving the logic as:

got_strh = FALSE
got_strf = FALSE

while parse_chunk (&tag):
  switch tag:
    case strh:
       if got_strh:
          warning ("duplicate strh chunk")
          break
       got_strh = TRUE
       parse_strh ()
       break;
    case strf:
       if got_strf:
          warning ("duplicate strf chunk")
          break
       if not got_strh:
          error ("got strf before strh")
          goto fail
       do_strh_and_strf_stuff ()
       break
    case strd:
       do_strd_stuff ()
       break;
    case other_tags:
       do_other_tag_stuff ();
       break;

if not got_strh:
  goto fail
if not got_strf:
  goto fail


This should preserve the current parsing semantics except that optional chunks
can occur before the strh and strf chunks.


-- 
Configure bugmail: http://bugzilla.gnome.org/userprefs.cgi?tab=email




More information about the Gstreamer-bugs mailing list