changeset 31721:f9eee489ab45

Only try to merge packets if we have a previous packet stored. Based on patch by 191919 [191919 gmail com].
author reimar
date Sat, 24 Jul 2010 17:18:46 +0000
parents 5dcb160d8ca9
children 92dd02d8ef2c
files vobsub.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/vobsub.c	Sat Jul 24 16:44:23 2010 +0000
+++ b/vobsub.c	Sat Jul 24 17:18:46 2010 +0000
@@ -1033,11 +1033,11 @@
                                             last_pts_diff = pkt->pts100 - mpg->pts;
                                         else
                                             pkt->pts100 = mpg->pts;
-                                        if (mpg->merge) {
+                                        if (mpg->merge && queue->current_index > 0) {
                                             packet_t *last = &queue->packets[queue->current_index - 1];
                                             pkt->pts100 = last->pts100;
-                                            mpg->merge = 0;
                                         }
+                                        mpg->merge = 0;
                                         /* FIXME: should not use mpg_sub internal informations, make a copy */
                                         pkt->data = mpg->packet;
                                         pkt->size = mpg->packet_size;