GNOME Bugzilla – Bug 793981
vaapi/mpeg2: segment fault when reverse playback
Last modified: 2018-11-03 15:53:36 UTC
I try rewind mpeg2 video(set playback rate to -1), however, segment fault caused at gstvaapidecoder_mpeg2.c:1461, traced by gdb, I found that packet.data value is 0x0. So, I think it is necessary to judge the value of packet.data before 1461, how do you think? Else, It was strange to me why packet.data was 0x0 when rewind, and it was a valid value when playback normally, Dose mpeg2 video not support rewinding? souce code: -------------------------------------------------------------------- 1454 if (!gst_buffer_map (buffer, &map_info, GST_MAP_READ)) { 1455 GST_ERROR ("failed to map buffer"); 1456 return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; 1457 } 1458 1459 packet.data = map_info.data + unit->offset; 1460 packet.size = unit->size; 1461 packet.type = packet.data[3]; 1462 packet.offset = 4; --------------------------------------------------------------------
It seems that mpeg2 doesn't support reverse playaback. Even gst-libav fails (graciously) to play in reverse mpeg2. Even yet, mpeg2 containers refuse to play in reverse mode. But I'm not sure were this, among the stack, should be fixed.
Looks like mpeg2 reverse playback is a hard problem https://stackoverflow.com/questions/9392152/mpeg-backwards-frame-decoding-using-ffmpeg
Created attachment 369225 [details] [review] libs: decoder: mpeg2: bail out if not enough data in buffer Naive solution checking if there is enough data in the buffer to decode. This happens when the containers wrongly permits reverse playback of mpeg2 streams.
I got it. Thanks for taking time to confirm this issue.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/issues/87.