diff --git a/src/totem-uri.c b/src/totem-uri.c
index 7148b17..d031ef6 100644
--- a/src/totem-uri.c
+++ b/src/totem-uri.c
@@ -697,6 +697,9 @@ totem_save_position (Totem *totem)
 	if (mrl == NULL)
 		return;
 
+	file = g_file_new_for_uri (mrl);
+	g_free (mrl);
+
 	/* Don't save if it's:
 	 *  - a live stream
 	 *  - too short to make saving useful
@@ -705,25 +708,31 @@ totem_save_position (Totem *totem)
 	if (stream_length < SAVE_POSITION_THRESHOLD ||
 	    (stream_length - position) < stream_length * SAVE_POSITION_END_THRESHOLD) {
 		g_debug ("not saving position because the video/track is too short");
-		g_free (mrl);
+
+		/* Remove the attribute if it is currently set on the file; this ensures that if we start watching a stream and save the position
+		 * half-way through, then later continue watching it to the end, the mid-way saved position will be removed when we finish the
+		 * stream. Only do this for non-live streams. */
+		if (stream_length > 0) {
+			g_file_set_attribute_string (file, SAVE_POSITION_FILE_ATTRIBUTE, NULL, G_FILE_QUERY_INFO_NONE, NULL, &error);
+			if (error != NULL) {
+				g_warning ("g_file_set_attribute_string failed: %s", error->message);
+				g_error_free (error);
+			}
+		}
+
+		g_object_unref (file);
 		return;
 	}
 
 	g_debug ("saving position: %"G_GINT64_FORMAT, position);
 
-	file = g_file_new_for_uri (mrl);
-	g_free (mrl);
-
 	/* Save the position in the stream as a file attribute */
 	pos_str = g_strdup_printf ("%"G_GINT64_FORMAT, position);
-	g_file_set_attribute (file,
-			      SAVE_POSITION_FILE_ATTRIBUTE,
-			      G_FILE_ATTRIBUTE_TYPE_STRING, pos_str,
-			      G_FILE_QUERY_INFO_NONE, NULL, &error);
+	g_file_set_attribute_string (file, SAVE_POSITION_FILE_ATTRIBUTE, pos_str, G_FILE_QUERY_INFO_NONE, NULL, &error);
 	g_free (pos_str);
 
 	if (error != NULL) {
-		g_warning ("g_file_set_attribute failed: %s", error->message);
+		g_warning ("g_file_set_attribute_string failed: %s", error->message);
 		g_error_free (error);
 	}
 	g_object_unref (file);
