]> git.sesse.net Git - vlc/blob - extras/contrib/src/Patches/libdvdnav-resolution.patch
Added a patch to the contribs to have a dvdnav_get_video_resolution() function in...
[vlc] / extras / contrib / src / Patches / libdvdnav-resolution.patch
1 Index: src/dvdnav/dvdnav.h
2 ===================================================================
3 --- src/dvdnav/dvdnav.h (revision 1191)
4 +++ src/dvdnav/dvdnav.h (working copy)
5 @@ -553,6 +553,11 @@
6  uint8_t dvdnav_get_video_aspect(dvdnav_t *self);
7  
8  /*
9 + * Get video resolution.
10 + */
11 +int dvdnav_get_video_resolution(dvdnav_t *self, uint32_t *width, uint32_t *height);
12 +
13 +/*
14   * Get video scaling permissions.
15   * The scaling permission does only change on VTS boundaries.
16   * See the DVDNAV_VTS_CHANGE event.
17 Index: src/vm/vm.c
18 ===================================================================
19 --- src/vm/vm.c (revision 1191)
20 +++ src/vm/vm.c (working copy)
21 @@ -858,8 +858,8 @@
22      break;
23    }
24  }
25 +#endif
26  
27 -/* currently unused */
28  void vm_get_video_res(vm_t *vm, int *width, int *height) {
29    video_attr_t attr = vm_get_video_attr(vm);
30  
31 @@ -883,7 +883,6 @@
32      break;
33    }
34  }
35 -#endif
36  
37  int vm_get_video_aspect(vm_t *vm) {
38    int aspect = vm_get_video_attr(vm).display_aspect_ratio;
39 Index: src/vm/vm.h
40 ===================================================================
41 --- src/vm/vm.h (revision 1191)
42 +++ src/vm/vm.h (working copy)
43 @@ -159,8 +159,8 @@
44  /* currently unused */
45  void vm_get_audio_info(vm_t *vm, int *current, int *num_avail);
46  void vm_get_subp_info(vm_t *vm, int *current, int *num_avail);
47 +#endif
48  void vm_get_video_res(vm_t *vm, int *width, int *height);
49 -#endif
50  int  vm_get_video_aspect(vm_t *vm);
51  int  vm_get_video_scale_permission(vm_t *vm);
52  video_attr_t vm_get_video_attr(vm_t *vm);
53 Index: src/dvdnav.c
54 ===================================================================
55 --- src/dvdnav.c        (revision 1191)
56 +++ src/dvdnav.c        (working copy)
57 @@ -844,7 +844,23 @@
58  
59    return retval;
60  }
61 +int dvdnav_get_video_resolution(dvdnav_t *this, uint32_t *width, uint32_t *height) {
62 +  int w, h;
63  
64 +  if(!this->started) {
65 +    printerr("Virtual DVD machine not started.");
66 +    return -1;
67 +  }
68 +
69 +  pthread_mutex_lock(&this->vm_lock);
70 +  vm_get_video_res(this->vm, &w, &h);
71 +  pthread_mutex_unlock(&this->vm_lock);
72 +  
73 +  *width  = w;
74 +  *height = h;
75 +  return 0;
76 +}
77 +
78  uint8_t dvdnav_get_video_scale_permission(dvdnav_t *this) {
79    uint8_t         retval;
80