]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/assdec.c
ac3enc_template: Use the correct context field
[ffmpeg] / libavformat / assdec.c
index 7bd3d173ac801b2d83177a84a85d1f90545b7201..f9f1bdfb9ae0a37e495b3fde816c0e63c00ca895 100644 (file)
@@ -63,7 +63,7 @@ static int64_t get_pts(const uint8_t *p)
     if (sscanf(p, "%*[^,],%d:%d:%d%*c%d", &hour, &min, &sec, &hsec) != 4)
         return AV_NOPTS_VALUE;
 
-    av_dlog(NULL, "%d %d %d %d [%s]\n", hour, min, sec, hsec, p);
+    av_log(NULL, AV_LOG_TRACE, "%d %d %d %d [%s]\n", hour, min, sec, hsec, p);
 
     min += 60 * hour;
     sec += 60 * min;
@@ -151,6 +151,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
 {
     ASSContext *ass = s->priv_data;
     uint8_t *p, *end;
+    int ret;
 
     if (ass->event_index >= ass->event_count)
         return AVERROR(EIO);
@@ -158,7 +159,9 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
     p = ass->event[ass->event_index];
 
     end = strchr(p, '\n');
-    av_new_packet(pkt, end ? end - p + 1 : strlen(p));
+    ret = av_new_packet(pkt, end ? end - p + 1 : strlen(p));
+    if (ret < 0)
+        return ret;
     pkt->flags |= AV_PKT_FLAG_KEY;
     pkt->pos    = p - ass->event_buffer + s->streams[0]->codec->extradata_size;
     pkt->pts    = pkt->dts = get_pts(p);