[FFmpeg-devel] [PATCHv3] mpeg4video: Add support for MPEG-4 Simple Studio Profile.

Carl Eugen Hoyos ceffmpeg at gmail.com
Mon Jan 29 00:22:46 EET 2018


2018-01-28 19:53 GMT+01:00 Kieran Kunhya <kieran618 at googlemail.com>:
> Possibly fixed by below patch but frankly the ER code is impenetrable.

+    /* In MPEG-4 studio mode look for a new slice startcode
+     * and decode slice header */
+    if(s->codec_id==AV_CODEC_ID_MPEG4 && s->studio_profile) {
+        align_get_bits(&s->gb);
+
+        while (get_bits_left(&s->gb) >= 32 && show_bits_long(&s->gb,
32) != SLICE_START_CODE) {
+            get_bits(&s->gb, 8);
+        }
+
+        if (show_bits_long(&s->gb, 32) == SLICE_START_CODE)
+            return get_bits_count(&s->gb);
+        else
+            return -1;
+    }

This hunk fixes the original issue I saw.

Does the following style that is used often in your patch have
any advantages?
"
    }
    else {
"
If yes, you should probably use it more consistently.

Still wondering why nobody else was able to reproduce, Carl Eugen


More information about the ffmpeg-devel mailing list