diff dvdnav.c @ 401:390fbf2a9602 src

Provide a way to retrieve video resolution. Needed for correct aspect ratio support in VLC. Patch by Jean-Baptiste Kempf /jb*videolan#org\
author rathann
date Tue, 25 May 2010 23:33:59 +0000
parents a70f79850e5f
children 1be2ffbeeb23
line wrap: on
line diff
--- a/dvdnav.c	Sun Sep 06 15:26:43 2009 +0000
+++ b/dvdnav.c	Tue May 25 23:33:59 2010 +0000
@@ -844,6 +844,22 @@
 
   return retval;
 }
+int dvdnav_get_video_resolution(dvdnav_t *this, uint32_t *width, uint32_t *height) {
+  int w, h;
+
+  if(!this->started) {
+    printerr("Virtual DVD machine not started.");
+    return -1;
+  }
+
+  pthread_mutex_lock(&this->vm_lock);
+  vm_get_video_res(this->vm, &w, &h);
+  pthread_mutex_unlock(&this->vm_lock);
+
+  *width  = w;
+  *height = h;
+  return 0;
+}
 
 uint8_t dvdnav_get_video_scale_permission(dvdnav_t *this) {
   uint8_t         retval;