From: <sl...@ke...> - 2008-03-08 04:27:17
|
CVS Root: /cvs/gstreamer Module: gst-plugins-bad Changes by: slomo Date: Sat Mar 08 2008 04:27:17 UTC Log message: Patch by: Sjoerd Simons <sjoerd at luon dot net> * ext/faad/gstfaad.c: (looks_like_valid_header): Improve the header checking to look for what faad2 looks for too. Fixes playback of same apple trailers. Fixes bug #469979. Modified files: . : ChangeLog ext/faad : gstfaad.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ChangeLog.diff?r1=1.3200&r2=1.3201 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ext/faad/gstfaad.c.diff?r1=1.67&r2=1.68 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-bad/ChangeLog,v retrieving revision 1.3200 retrieving revision 1.3201 diff -u -d -r1.3200 -r1.3201 --- ChangeLog 7 Mar 2008 13:28:04 -0000 1.3200 +++ ChangeLog 8 Mar 2008 04:27:02 -0000 1.3201 @@ -1,3 +1,12 @@ +2008-03-08 Sebastian Dröge <sl...@ci...> + + Patch by: Sjoerd Simons <sjoerd at luon dot net> + * ext/faad/gstfaad.c: (looks_like_valid_header): + Improve the header checking to look for what faad2 looks + for too. Fixes playback of same apple trailers. + Fixes bug #469979. 2008-03-07 Sebastian Dröge <sl...@ci...> * configure.ac: Index: gstfaad.c RCS file: /cvs/gstreamer/gst-plugins-bad/ext/faad/gstfaad.c,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 --- gstfaad.c 31 Jan 2008 15:52:18 -0000 1.67 +++ gstfaad.c 8 Mar 2008 04:27:03 -0000 1.68 @@ -1141,22 +1141,19 @@ static gboolean looks_like_valid_header (guint8 * input_data, guint input_size) { - guint32 rate; - guint32 channels; - - if (input_size < 2) + if (input_size < 4) return FALSE; - rate = ((input_data[0] & 0x7) << 1) | ((input_data[1] & 0x80) >> 7); - channels = (input_data[1] & 0x78) >> 3; - if (rate == 0xd || rate == 0xe) /* Reserved values */ - return FALSE; + if (input_data[0] == 'A' + && input_data[1] == 'D' && input_data[2] == 'I' && input_data[3] == 'F') + /* ADIF type header */ + return TRUE; - if (channels == 0) /* Extended specifier: never seen one of these */ + if (input_data[0] == 0xff && (input_data[1] >> 4) == 0xf) + /* ADTS type header */ - return TRUE; + return FALSE; } static GstFlowReturn |