[MPlayer-dev-eng] [PATCH] vobsub fix

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Jul 20 19:45:01 CEST 2010


On Tue, Jul 20, 2010 at 09:10:25PM +0800, 191919 wrote:
> Here is the new patch generated by "diff -uw".

On the plus side, you patch can only improve things, so it's good.
Though I think the code is nicer if done liek this:
Index: vobsub.c
===================================================================
--- vobsub.c    (revision 31758)
+++ vobsub.c    (working copy)
@@ -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) {
                                             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;


However, I think this only hides the real bug somewhere else, I don't think
mpg->merge should ever be set when there is no previous packet.
For example, one bug is that none of the seek/reset functions sets
mpg->merge to 0.


More information about the MPlayer-dev-eng mailing list