From a7377ff9a3effa00ca8ace6bd19a2708b35d28d7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 19 Oct 2006 10:17:14 +0000 Subject: [PATCH] ext/dvdread/dvdreadsrc.c: Use dsi_pack.dsi_gi.vobu_ea correctly, add some more debugging information (fixes #340433). Original commit message from CVS: * ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_read): Use dsi_pack.dsi_gi.vobu_ea correctly, add some more debugging information (fixes #340433). --- ChangeLog | 6 ++++++ ext/dvdread/dvdreadsrc.c | 14 ++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index ee50b92..6688ac2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-10-19 Tim-Philipp Müller + + * ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_read): + Use dsi_pack.dsi_gi.vobu_ea correctly, add some more debugging + information (fixes #340433). + 2006-10-16 Tim-Philipp Müller Patch by: Josep Torra Valles diff --git a/ext/dvdread/dvdreadsrc.c b/ext/dvdread/dvdreadsrc.c index 9b41bfa..c766076 100644 --- a/ext/dvdread/dvdreadsrc.c +++ b/ext/dvdread/dvdreadsrc.c @@ -765,11 +765,14 @@ again: /* we loop until we're out of this cell */ src->cur_pack = src->cur_pgc->cell_playback[src->cur_cell].first_sector; src->new_cell = FALSE; + GST_DEBUG_OBJECT (src, "Starting new cell %d @ pack %d", src->cur_cell, + src->cur_pack); } if (src->cur_pack >= src->cur_pgc->cell_playback[src->cur_cell].last_sector) { src->new_cell = TRUE; - GST_LOG_OBJECT (src, "Beyond last sector, go to next cell"); + GST_LOG_OBJECT (src, "Beyond last sector for cell %d, going to next cell", + src->cur_cell); return GST_DVD_READ_AGAIN; } @@ -781,6 +784,7 @@ nav_retry: goto read_error; if (!gst_dvd_read_src_is_nav_pack (oneblock)) { + GST_LOG_OBJECT (src, "Skipping nav packet @ pack %d", src->cur_pack); src->cur_pack++; goto nav_retry; } @@ -792,7 +796,7 @@ nav_retry: /* determine where we go next. These values are the ones we * mostly care about */ next_ilvu_start = src->cur_pack + dsi_pack.sml_agli.data[angle].address; - cur_output_size = dsi_pack.dsi_gi.vobu_ea; + cur_output_size = dsi_pack.dsi_gi.vobu_ea + 1; /* If we're not at the end of this cell, we can determine the next * VOBU to display using the VOBU_SRI information section of the @@ -805,15 +809,17 @@ nav_retry: if (dsi_pack.vobu_sri.next_vobu != SRI_END_OF_CELL) { next_vobu = src->cur_pack + (dsi_pack.vobu_sri.next_vobu & 0x7fffffff); } else { - next_vobu = src->cur_pack + cur_output_size + 1; + next_vobu = src->cur_pgc->cell_playback[src->cur_cell].last_sector + 1; } g_assert (cur_output_size < 1024); - ++src->cur_pack; /* create the buffer (TODO: use buffer pool?) */ buf = gst_buffer_new_and_alloc (cur_output_size * DVD_VIDEO_LB_LEN); + GST_LOG_OBJECT (src, "Going to read %u sectors @ pack %d", cur_output_size, + src->cur_pack); + /* read in and output cursize packs */ len = DVDReadBlocks (src->dvd_title, src->cur_pack, cur_output_size, GST_BUFFER_DATA (buf)); -- 2.7.4