OSDN Git Service

add bootstrap step to libdca
[handbrake-jp/handbrake-jp-git.git] / contrib / mpeg2dec / A00-tags.patch
1 diff -ru mpeg2dec.orig/libmpeg2/decode.c mpeg2dec/libmpeg2/decode.c
2 --- mpeg2dec.orig/libmpeg2/decode.c     2008-07-09 12:16:05.000000000 -0700
3 +++ mpeg2dec/libmpeg2/decode.c  2009-07-03 16:29:48.000000000 -0700
4 @@ -212,7 +212,7 @@
5  
6  mpeg2_state_t mpeg2_parse_header (mpeg2dec_t * mpeg2dec)
7  {
8 -    static int (* process_header[]) (mpeg2dec_t * mpeg2dec) = {
9 +    static int (* process_header[]) (mpeg2dec_t *) = {
10         mpeg2_header_picture, mpeg2_header_extension, mpeg2_header_user_data,
11         mpeg2_header_sequence, NULL, NULL, NULL, NULL, mpeg2_header_gop
12      };
13 @@ -368,6 +368,14 @@
14  
15  void mpeg2_tag_picture (mpeg2dec_t * mpeg2dec, uint32_t tag, uint32_t tag2)
16  {
17 +    if (mpeg2dec->num_tags == 0 && mpeg2dec->state == STATE_PICTURE && mpeg2dec->picture) {
18 +        // since tags got processed when we entered this state we
19 +        // have to set them directly or they'll end up on the next frame.
20 +        mpeg2dec->picture->tag = tag;
21 +        mpeg2dec->picture->tag2 = tag2;
22 +        mpeg2dec->picture->flags |= PIC_FLAG_TAGS;
23 +        return;
24 +    }
25      mpeg2dec->tag_previous = mpeg2dec->tag_current;
26      mpeg2dec->tag2_previous = mpeg2dec->tag2_current;
27      mpeg2dec->tag_current = tag;