Set initial value of timestamp to invalid value 27/175727/3
authorSejun Park <sejun79.park@samsung.com>
Wed, 11 Apr 2018 09:57:00 +0000 (18:57 +0900)
committerSejun Park <sejun79.park@samsung.com>
Wed, 18 Apr 2018 02:32:23 +0000 (11:32 +0900)
Change-Id: Iaaf975b460002f8ab357dca90285291a6f2e0a0d

include/media_packet_private.h
packaging/capi-media-tool.spec
src/media_packet.c

index 6729ffb1262091223815bd38b5652565e9bf5da9..628ce8767a7d445eea196640a1aff9289f21df61 100755 (executable)
@@ -39,6 +39,13 @@ extern "C" {
 #define MEDIA_PACKET_NULL_ARG_CHECK(arg)      \
        MEDIA_PACKET_CHECK_CONDITION(arg != NULL, MEDIA_PACKET_ERROR_INVALID_PARAMETER, "MEDIA_PACKET_ERROR_INVALID_PARAMETER")
 
+/**
+ *  CLOCK_TIME_NONE: (value 18446744073709551615)
+ *
+ *  Constant to define an undefined clock time.
+ */
+#define CLOCK_TIME_NONE ((uint64_t) -1)
+
 /**
  * @brief Gets pts of media_packet_h
  * @since_tizen 2.3
index 79f3b212ea4cc6fc604e19e51d3dd4ee4a6a10b8..d78a5005ebf9d6df4726b786e9fba461e714ebbb 100755 (executable)
@@ -1,7 +1,7 @@
 Name:       capi-media-tool
 Summary:    A Core API media tool library in Tizen Native API
-Version:    0.1.8
-Release:    3
+Version:    0.1.9
+Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
index d8a9265ba6ef66b7684ad95c78aba3cead94380a..00229e2df9d04ea438f0436e7440c6149bf9204b 100755 (executable)
@@ -244,6 +244,11 @@ int _pkt_alloc_buffer(media_packet_s *pkt)
        /* skip validating pkt */
        size_t buffersize = 0;
 
+       /* initialize packet */
+       pkt->pts = CLOCK_TIME_NONE;
+       pkt->dts = CLOCK_TIME_NONE;
+       pkt->duration = CLOCK_TIME_NONE;
+
        if (pkt->type == MEDIA_BUFFER_TYPE_NORMAL) {
                /* need to use format,width,height to get buffer size */
                if (MEDIA_FORMAT_IS_VIDEO(pkt->format))
@@ -315,6 +320,7 @@ int _pkt_alloc_buffer(media_packet_s *pkt)
                }
 
        }
+
        return MEDIA_PACKET_ERROR_NONE;
 }
 
@@ -391,8 +397,7 @@ int _pkt_reset_buffer(media_packet_h packet)
 #define MAX(a, b)  (((a) > (b)) ? (a) : (b))
 static size_t _pkt_calculate_video_buffer_size(media_packet_s *pkt)
 {
-       int size, w2, h2, size2;
-       int stride, stride2;
+       int stride = 0;
        int width = 0;
        int height = 0;
        size_t buffersize = 0;