skip 2 bytes is wrong while checking mpegaudio header which will cause a long waiting.
Submitted by Jason.Chiang
Link to original bug (#779962)
Description
Created attachment 347789
patch
If we seek this audio file from the middle (e.g: 20s), the parsing of the mpegaudio header will cost lots of time, and the payload of CPU is high.
I checked the gst_mpeg_audio_parse_handle_frame() function in gst/audioparsers/gstmpegaudioparse.c, and found it is wrong to skip 2 bytes after gst_mp3parse_validate_extended() is called and valid == false.
PS: We call gst_mpeg_audio_parse_head_check() and it return a false, then we goto cleanup, filesrc send a new frame buffer. This process will cost more time than we check all the bytes stored in a frame at once.
Patch 347789, "patch":
0001-fix-skip-2-bytes-is-wrong-while-checking-mpegaudio-h.patch