[vlc-commits] [Git][videolan/vlc][master] 2 commits: dvdread: expose per-track timestamps for DVD-Audio chapters

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Sun Apr 19 11:18:17 UTC 2026



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
07d2798c by Felix Paul Kühne at 2026-04-19T13:03:35+02:00
dvdread: expose per-track timestamps for DVD-Audio chapters

Read first_pts_of_track from the ATS IFO's atsi_track_timestamp_rows
and populate each seekpoint's i_time_offset accordingly, so chapter
durations are derivable and time-based seeking works.

- - - - -
9f6b4e61 by Felix Paul Kühne at 2026-04-19T13:03:35+02:00
dvdread: guard DVD-VR-only helpers behind DVDREAD_HAS_DVDVIDEORECORDING

- - - - -


1 changed file:

- modules/access/dvdread.c


Changes:

=====================================
modules/access/dvdread.c
=====================================
@@ -2133,6 +2133,7 @@ static void DvdReadFindCell( demux_t *p_demux )
     }
 }
 
+#ifdef DVDREAD_HAS_DVDVIDEORECORDING
 static const char* ParseTxtEncoding( uint8_t txt_encoding )
 {
     const char* charset = "Unknown";
@@ -2150,6 +2151,7 @@ static const char* ParseTxtEncoding( uint8_t txt_encoding )
 
     return charset;
 }
+#endif
 
 /*****************************************************************************
  * DemuxTitles: get the titles/chapters or group/tracks structure
@@ -2267,22 +2269,48 @@ static void DemuxTitles( demux_t *p_demux, int *pi_angle )
 #endif
         {
 #ifdef DVDREAD_HAS_DVDAUDIO
-            if ( p_sys->type == DVD_A )
-                t->i_length = FROM_SCALE_NZ( p_sys->p_vmg_file->
-                                            info_table_second_sector->tracks_info[i].len_audio_zone_pts );
+            ifo_handle_t *p_ats_ifo = NULL;
+            const atsi_track_timestamp_t *p_track_ts = NULL;
+            uint8_t i_track_ts = 0;
+
+            if ( p_sys->type == DVD_A ) {
+                const track_info_t * const p_track_info =
+                    &p_sys->p_vmg_file->info_table_second_sector->tracks_info[i];
+                t->i_length = FROM_SCALE_NZ( p_track_info->len_audio_zone_pts );
+
+                p_ats_ifo = ifoOpen( p_sys->p_dvdread, p_track_info->group_property );
+                if ( p_ats_ifo != NULL && p_ats_ifo->atsi_title_table != NULL
+                     && p_track_info->title_property > 0
+                     && p_track_info->title_property <= p_ats_ifo->atsi_title_table->nr_titles ) {
+                    const atsi_title_record_t * const p_title_rec =
+                        &p_ats_ifo->atsi_title_table->atsi_title_row_tables[p_track_info->title_property - 1];
+                    p_track_ts = p_title_rec->atsi_track_timestamp_rows;
+                    i_track_ts = p_title_rec->nr_tracks;
+                }
+            }
 #endif
             for( j = 0; j < __MAX( i_chapters, 1 ); j++ )
             {
                 s = vlc_seekpoint_New();
+#ifdef DVDREAD_HAS_DVDAUDIO
+                if ( p_track_ts != NULL && j < i_track_ts )
+                    s->i_time_offset =
+                        FROM_SCALE_NZ( (uint64_t)p_track_ts[j].first_pts_of_track );
+#endif
                 TAB_APPEND( t->i_seekpoint, t->seekpoint, s );
             }
+#ifdef DVDREAD_HAS_DVDAUDIO
+            if ( p_ats_ifo != NULL )
+                ifoClose( p_ats_ifo );
+#endif
         }
         TAB_APPEND( p_sys->i_titles, p_sys->titles, t );
     }
     return;
 
+#ifdef DVDREAD_HAS_DVDVIDEORECORDING
 fail:
     vlc_input_title_Delete( t );
     return;
-
+#endif
 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/12500a0c95deb2b3375aee39e0fedbf330627262...9f6b4e61c2c6a4733860a6e5be0b916791f0039f

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/12500a0c95deb2b3375aee39e0fedbf330627262...9f6b4e61c2c6a4733860a6e5be0b916791f0039f
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list