oggdec: Move warning about missing granule to the correct place
authorDavid Conrad <lessen42@gmail.com>
Fri, 16 Apr 2010 12:21:38 +0000 (12:21 +0000)
committerDavid Conrad <lessen42@gmail.com>
Fri, 16 Apr 2010 12:21:38 +0000 (12:21 +0000)
Originally committed as revision 22891 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/oggdec.c

index 3b59e00..f24f697 100644 (file)
@@ -362,6 +362,9 @@ ogg_packet (AVFormatContext * s, int *str, int *dstart, int *dsize, int64_t *fpo
             idx, os->psize, os->pstart);
 #endif
 
+    if (os->granule == -1)
+        av_log(s, AV_LOG_WARNING, "Page at %lld is missing granule\n", os->page_pos);
+
     ogg->curidx = idx;
     os->incomplete = 0;
 
@@ -512,8 +515,7 @@ static int64_t ogg_calc_pts(AVFormatContext *s, int idx, int64_t *dts)
             else
                 os->lastpts = ogg_gptopts(s, idx, os->granule, &os->lastdts);
             os->granule = -1LL;
-        } else
-            av_log(s, AV_LOG_WARNING, "Packet is missing granule\n");
+        }
     }
     return pts;
 }